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

Unified Diff: appengine/findit/waterfall/detect_first_failure_pipeline.py

Issue 2139093002: [Findit] Trigger swarming tasks after detech_first_faliure_pipeline (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: . Created 4 years, 5 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: appengine/findit/waterfall/detect_first_failure_pipeline.py
diff --git a/appengine/findit/waterfall/detect_first_failure_pipeline.py b/appengine/findit/waterfall/detect_first_failure_pipeline.py
index 06cc093a024b4eacbe62398ac14c82f166031df6..b1e4287ba5056ba44a287eb7bf4ce17761464650 100644
--- a/appengine/findit/waterfall/detect_first_failure_pipeline.py
+++ b/appengine/findit/waterfall/detect_first_failure_pipeline.py
@@ -19,6 +19,30 @@ from waterfall import swarming_util
_MAX_BUILDS_TO_CHECK = 20
_NON_FAILURE_STATUS = ['SUCCESS', 'SKIPPED', 'UNKNOWN']
+_PRE_TEST_PREFIX = 'PRE_'
+
+
+def _RemoveAllPrefixes(test):
+ """Remove prefixes from test names.
+
+ Args:
+ test (str): A test's name, eg: 'suite1.PRE_test1'.
+
+ Returns:
+ base_test (str): A base test name, eg: 'suite1.test1'.
+ """
+ test_name_start = max(test.find('.'), 0)
+ if test_name_start == 0:
+ return test
+
+ test_suite = test[: test_name_start]
+ test_name = test[test_name_start + 1 :]
+ pre_position = test_name.find(_PRE_TEST_PREFIX)
+ while pre_position == 0:
+ test_name = test_name[len(_PRE_TEST_PREFIX):]
+ pre_position = test_name.find(_PRE_TEST_PREFIX)
+ base_test = '%s.%s' % (test_suite, test_name)
+ return base_test
class DetectFirstFailurePipeline(BasePipeline):
@@ -195,6 +219,7 @@ class DetectFirstFailurePipeline(BasePipeline):
failed_step['tests'][test_name] = {
'current_failure': failed_step['current_failure'],
'first_failure': failed_step['current_failure'],
+ 'base_test_name': _RemoveAllPrefixes(test_name)
}
if failed_step.get('last_pass'):
failed_step['tests'][test_name]['last_pass'] = (

Powered by Google App Engine
This is Rietveld 408576698