Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2544)

Unified Diff: recipe_engine/test.py

Issue 2828823003: Detect duplicate recipe tests (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | unittests/test_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/test.py
diff --git a/recipe_engine/test.py b/recipe_engine/test.py
index 0a12c0c57be5bf3a185babd9a810328f605688da..2924b206e684ff3b3738f9885ab45175148460fa 100644
--- a/recipe_engine/test.py
+++ b/recipe_engine/test.py
@@ -409,8 +409,10 @@ def get_tests(test_filter=None):
# a weird recipe generates tests non-deterministically. The recipe
# engine should be robust against such user recipe code where
# reasonable.
- _GEN_TEST_CACHE[(recipe_name, test_data.name)] = copy.deepcopy(
- test_data)
+ key = (recipe_name, test_data.name)
+ if key in _GEN_TEST_CACHE:
+ raise ValueError('Duplicate test found: %s' % test_data.name)
iannucci1 2017/04/19 18:12:42 I think the error should indicate which recipe the
Paweł Hajdan Jr. 2017/04/19 18:17:06 It does, please see the test: Exception: While ge
+ _GEN_TEST_CACHE[key] = copy.deepcopy(test_data)
test_description = TestDescription(
recipe_name, test_data.name, expect_dir, covers)
« no previous file with comments | « no previous file | unittests/test_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698