Skip to content

Instantly share code, notes, and snippets.

@ahal
Created December 13, 2018 20:40
Show Gist options
  • Save ahal/c2fda1ac76fce81682a4dfc7ad0fa882 to your computer and use it in GitHub Desktop.
Save ahal/c2fda1ac76fce81682a4dfc7ad0fa882 to your computer and use it in GitHub Desktop.
diff --git a/adr/recipes/intermittent_tests.py b/adr/recipes/intermittent_tests.py
index ff4b3fe..ffbb0a3 100644
--- a/adr/recipes/intermittent_tests.py
+++ b/adr/recipes/intermittent_tests.py
@@ -2,36 +2,33 @@
This is currently broken.
.. code-block:: bash
adr intermittent_tests
"""
from __future__ import print_function, absolute_import
-from ..recipe import RecipeParser
+from ..recipe import execute_query
from ..query import run_query
-def run(args, config):
- parser = RecipeParser('branch', 'build', 'date', 'platform')
- args = parser.parse_args(args)
-
+def run(args):
# These 4 args are defined so that we can share the queries with the
# 'intermittent_test_data' recipe.
- args.test = '(~(file.*|http.*))'
+ args.test_name = '(~(file.*|http.*))'
args.groupby = 'result.test'
args.result = ["F"]
args.platform_config = "test-%s/%s" % (args.platform, args.build_type)
query_args = vars(args)
- jobs = next(run_query('intermittent_jobs', config, **query_args))['data']
- result = next(run_query('intermittent_tests', config, **query_args))['data']
- total_runs = next(run_query('intermittent_test_rate', config, **query_args))['data']
+ jobs = execute_query('intermittent_jobs', query_args)['data']
+ result = execute_query('intermittent_tests', query_args)['data']
+ total_runs = execute_query('intermittent_test_rate', query_args)['data']
intermittent_tests = []
# for each result, match up the revision/name with jobs, if a match, save testname
index = -1
for item in result['result.test']:
index += 1
rev = result['repo.changeset.id12'][index]
jobname = result['run.key'][index]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment