autotest: Add model check in afe job duplication checking.
This CL let run_suite not skip the jobs with the same name but different model.
test_server.py:
parser = run_suite.make_parser()
options = parser.parse_args()
print(run_suite._should_run(options))
./test_server.py **** --model blue => False
./test_server.py **** --model epaulette => True
BUG=chromium:919590
TEST=See commit message above.
Change-Id: I46edb662864b0db660102156b8d6a8311fb7919f
Reviewed-on: https://chromium-review.googlesource.com/1524764
Commit-Ready: Dinesh Kumar Sunkara <dsunkara@google.com>
Tested-by: Dinesh Kumar Sunkara <dsunkara@google.com>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Harpreet Grewal <harpreet@chromium.org>
diff --git a/site_utils/run_suite.py b/site_utils/run_suite.py
index b66010f..ac8a4df 100755
--- a/site_utils/run_suite.py
+++ b/site_utils/run_suite.py
@@ -1954,14 +1954,20 @@
start_time = str(datetime.now() -
timedelta(days=_SEARCH_JOB_MAX_DAYS))
afe = _create_afe(options)
- afe_job_id = afe.get_jobs(
+ afe_jobs = afe.get_jobs(
name__istartswith=options.test_source_build,
name__iendswith='control.'+options.name,
created_on__gte=start_time,
min_rpc_timeout=_MIN_RPC_TIMEOUT)
- if afe_job_id:
+ if options.model:
+ model_tag = 'model:%s' % options.model
+ filtered_jobs = [j for j in afe_jobs if model_tag in j.control_file]
+ else:
+ filtered_jobs = afe_jobs
+
+ if filtered_jobs:
logging.info('Found duplicate suite %s scheduled in past.',
- afe_job_id)
+ filtered_jobs)
return False
return True