Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: go/test.py

Issue 1042633002: Add support for -tags to enable appengine testing. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/src/infra/gae/apps/helloworld/helloworld.infra_testing ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/test.py
diff --git a/go/test.py b/go/test.py
index a44ec29b60e49e69c9661acbf476540d49c7774d..5eb43e1b404195b2a3aae756060c10e553dccfb2 100755
--- a/go/test.py
+++ b/go/test.py
@@ -32,6 +32,7 @@ EXPECTED_INFO_KEYS = frozenset([
'skip_testing',
'expected_coverage_min',
'expected_coverage_max',
+ 'build_tags',
])
@@ -139,6 +140,12 @@ def should_skip(package):
"""True to skip package tests, reads 'skip_testing' from *.infra_testing."""
return get_package_info(package).get('skip_testing', False)
+def get_build_tags(package):
+ """True to skip package tests, reads 'skip_testing' from *.infra_testing."""
+ tags = get_package_info(package).get('build_tags', ())
+ if tags:
+ return '-tags='+(','.join(tags))
+ return None
def get_expected_coverage(package):
"""Returns allowed code coverage percentage as a pair (min, max)."""
@@ -173,7 +180,10 @@ def run_package_tests(package, coverage_file):
assert os.path.isabs(coverage_file), coverage_file
# Ask go test to collect coverage to a file, to convert it to HTML later.
- cmd = ['go', 'test', package]
+ cmd = ['go', 'test', package, ]
Vadim Sh. 2015/03/30 06:05:40 nit: remove ", "
+ build_tags = get_build_tags(package)
+ if build_tags:
+ cmd.append(build_tags)
makedirs(os.path.dirname(coverage_file))
coverage_out = '%s.out' % coverage_file
cmd.extend(['-coverprofile', coverage_out])
« no previous file with comments | « go/src/infra/gae/apps/helloworld/helloworld.infra_testing ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698