summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Rue <dan.rue@linaro.org>2017-05-26 14:00:10 -0500
committerDan Rue <dan.rue@linaro.org>2017-05-30 08:51:43 -0500
commitd9d7b6588b7e74078581c173432de0dbc3333d0a (patch)
treecedfd9edfce95328eeec5fad068442b223a17a5d
parent748a54de13a6d5cfb3199b3cb0882dcc99bc279f (diff)
test-runner: Skip duplicate tests
This commit adds checking to ensure that duplicate tests are not added to the test plan. Change-Id: I045c16467cc17812a4559a14ac66e55a9c33a189 Signed-off-by: Dan Rue <dan.rue@linaro.org>
-rwxr-xr-xautomated/utils/test-runner.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/automated/utils/test-runner.py b/automated/utils/test-runner.py
index 2f113d8..a6260e0 100755
--- a/automated/utils/test-runner.py
+++ b/automated/utils/test-runner.py
@@ -65,12 +65,20 @@ class TestPlan(object):
test_plan = yaml.safe_load(f)
try:
test_list = []
+ unique_tests = [] # List of test hashes
for requirement in test_plan['requirements']:
if 'tests' in requirement.keys():
if requirement['tests'] and \
kind in requirement['tests'].keys() and \
requirement['tests'][kind]:
for test in requirement['tests'][kind]:
+ test_hash = hash(json.dumps(test, sort_keys=True))
+ if test_hash in unique_tests:
+ # Test is already in the test_list; don't add it again.
+ self.logger.warning(
+ "Skipping duplicate test {}".format(test))
+ continue
+ unique_tests.append(test_hash)
test_list.append(test)
for test in test_list:
test['uuid'] = str(uuid4())