From 4862359354d8946fea266a23d356a7cac122b120 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 2 Aug 2017 18:15:22 -0700 Subject: Improve flakes query --- tools/run_tests/run_tests.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 106c7e0699..19186bea12 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -74,19 +74,21 @@ def get_flaky_tests(limit=None): bq = big_query_utils.create_big_query() query = """ - SELECT - test_name, - SUM(result != 'PASSED' - AND result != 'SKIPPED') AS count_failed, - FROM - [grpc-testing:jenkins_test_results.aggregate_results] - WHERE - timestamp >= DATE_ADD(CURRENT_DATE(), -1, "WEEK") - AND NOT REGEXP_MATCH(job_name, '.*portability.*') - GROUP BY - test_name - HAVING - count_failed > 0""" +SELECT + filtered_test_name, + FROM ( + SELECT + REGEXP_REPLACE(test_name, r'/\d+', '') AS filtered_test_name, + result + FROM + [grpc-testing:jenkins_test_results.aggregate_results] + WHERE + timestamp >= DATE_ADD(CURRENT_DATE(), -1, "WEEK") + AND NOT REGEXP_MATCH(job_name, '.*portability.*') ) +GROUP BY + filtered_test_name +HAVING + SUM(result != 'PASSED' AND result != 'SKIPPED') > 0""" if limit: query += " limit {}".format(limit) query_job = big_query_utils.sync_query_job(bq, 'grpc-testing', query) -- cgit v1.2.3