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

Unified Diff: scripts/slave/recipe_modules/filter/example.py

Issue 427073003: Adds ability to filter the set of tests that are run by a bot (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: merge to trunk Created 6 years, 4 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
Index: scripts/slave/recipe_modules/filter/example.py
diff --git a/scripts/slave/recipe_modules/filter/example.py b/scripts/slave/recipe_modules/filter/example.py
index 09911b744b6f701e5ce47f8740f213fd0b1b9401..c1388a98c32a06ed6b91e649c030f861420b78d1 100644
--- a/scripts/slave/recipe_modules/filter/example.py
+++ b/scripts/slave/recipe_modules/filter/example.py
@@ -5,6 +5,7 @@
DEPS = [
'chromium',
'filter',
+ 'json',
'path',
'properties',
'raw_io',
@@ -16,15 +17,16 @@ def GenSteps(api):
api.filter.does_patch_require_compile()
assert (api.filter.result and api.properties['example_result']) or \
(not api.filter.result and not api.properties['example_result'])
+ assert (not api.properties['example_matching_exes'] or
+ list(api.properties['example_matching_exes']) ==
+ api.filter.matching_exes)
def GenTests(api):
# Trivial test with no exclusions and nothing matching.
yield (api.test('basic') +
api.properties(filter_exclusions=[]) +
api.properties(example_result=None) +
- api.override_step_data(
- 'analyze',
- api.raw_io.stream_output('xx')) +
+ api.properties(example_matching_exes=None) +
api.override_step_data(
'git diff to analyze patch',
api.raw_io.stream_output('yy')))
@@ -33,6 +35,7 @@ def GenTests(api):
yield (api.test('match_exclusion') +
api.properties(filter_exclusions=['fo.*']) +
api.properties(example_result=1) +
+ api.properties(example_matching_exes=None) +
api.override_step_data(
'git diff to analyze patch',
api.raw_io.stream_output('foo.cc')))
@@ -41,9 +44,7 @@ def GenTests(api):
yield (api.test('doesnt_match_exclusion') +
api.properties(filter_exclusions=['fo.*']) +
api.properties(example_result=None) +
- api.override_step_data(
- 'analyze',
- api.raw_io.stream_output('xx')) +
+ api.properties(example_matching_exes=None) +
api.override_step_data(
'git diff to analyze patch',
api.raw_io.stream_output('bar.cc')))
@@ -51,6 +52,27 @@ def GenTests(api):
# Analyze returns matching result.
yield (api.test('analyzes_returns_true') +
api.properties(example_result=1) +
+ api.properties(example_matching_exes=None) +
+ api.override_step_data(
+ 'analyze',
+ api.json.output({'status': 'Found dependency',
+ 'targets': []})))
+
+ # Analyze returns matching tests.
+ yield (api.test('analyzes_matches_exes') +
+ api.properties(matching_exes=['foo', 'bar']) +
+ api.properties(example_matching_exes=['foo']) +
+ api.properties(example_result=1) +
+ api.override_step_data(
+ 'analyze',
+ api.json.output({'status': 'Found dependency',
+ 'targets': ['foo']})))
+
+ # Analyze with error condition.
+ yield (api.test('analyzes_error') +
+ api.properties(matching_exes=None) +
+ api.properties(example_matching_exes=None) +
+ api.properties(example_result=1) +
api.override_step_data(
'analyze',
- api.raw_io.stream_output('Found dependency')))
+ api.json.output({'error': 'ERROR'})))
« no previous file with comments | « scripts/slave/recipe_modules/filter/api.py ('k') | scripts/slave/recipe_modules/filter/example.expected/analyzes_error.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698