Commit 1010ec70b1 enabled all tests by default. In some scenarios where the configuration is static one may not want newly added tests to be run.
Signed-off-by: Michael Hanselmann <[email protected]> --- qa/qa-sample.json | 3 +++ qa/qa_config.py | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/qa/qa-sample.json b/qa/qa-sample.json index 7ec51a8..0cfdf2e 100644 --- a/qa/qa-sample.json +++ b/qa/qa-sample.json @@ -56,6 +56,9 @@ }, "tests": { + "# Whether tests are enabled or disabled by default": null, + "default": true, + "env": true, "os": true, "tags": true, diff --git a/qa/qa_config.py b/qa/qa_config.py index b4cff14..e058a71 100644 --- a/qa/qa_config.py +++ b/qa/qa_config.py @@ -68,7 +68,14 @@ def TestEnabled(tests): """ if isinstance(tests, basestring): tests = [tests] - return compat.all(cfg.get("tests", {}).get(t, True) for t in tests) + + # Get settings for all tests + all_tests = cfg.get("tests", {}) + + # Get default setting + default = all_tests.get("default", True) + + return compat.all(all_tests.get(name, default) for name in tests) def GetMasterNode(): -- 1.7.6
