diff options
author | David Garcia Quintas <dgq@google.com> | 2017-08-02 18:15:22 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2017-08-02 18:15:22 -0700 |
commit | 4862359354d8946fea266a23d356a7cac122b120 (patch) | |
tree | 50ac969113ce157b1186457b876004852f2d4802 | |
parent | 04034515e28fc7780427f9cf87fbe1496b7ec810 (diff) |
Improve flakes query
-rwxr-xr-x | tools/run_tests/run_tests.py | 28 |
1 files 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) |