summaryrefslogtreecommitdiff
path: root/buildscripts/tests/resmokelib/test_selector.py
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-09-27 16:59:46 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-10-03 15:22:30 -0400
commitb665d7a575ca08c6d6157f35f2d4bb6bf38a8388 (patch)
treeb72b6840c676bb77d6aaf3cc73d2dd37611fc09a /buildscripts/tests/resmokelib/test_selector.py
parent58501015eff7961dc378abe1d49e064a3dcf3dbc (diff)
downloadmongo-b665d7a575ca08c6d6157f35f2d4bb6bf38a8388.tar.gz
SERVER-33853 Define a new test tag, test_disabled, to temporarily disable a test
Diffstat (limited to 'buildscripts/tests/resmokelib/test_selector.py')
-rw-r--r--buildscripts/tests/resmokelib/test_selector.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/buildscripts/tests/resmokelib/test_selector.py b/buildscripts/tests/resmokelib/test_selector.py
index edba22ba7b3..852272aecee 100644
--- a/buildscripts/tests/resmokelib/test_selector.py
+++ b/buildscripts/tests/resmokelib/test_selector.py
@@ -5,6 +5,7 @@ from __future__ import absolute_import
import fnmatch
import unittest
+import buildscripts.resmokelib.parser as parser
import buildscripts.resmokelib.selector as selector
import buildscripts.resmokelib.utils.globstar as globstar
import buildscripts.resmokelib.config
@@ -497,6 +498,27 @@ class TestFilterTests(unittest.TestCase):
selected)
self.assertEqual(["dir/subdir1/test11.js"], excluded)
+ def test_jstest_exclude_with_any_tags(self):
+ config = {
+ "roots": ["dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"],
+ "exclude_with_any_tags": ["tag2"]
+ }
+ selected, excluded = selector.filter_tests("js_test", config, self.test_file_explorer)
+ self.assertEqual(["dir/subdir1/test11.js", "dir/subdir2/test21.js"], excluded)
+ self.assertEqual(["dir/subdir1/test12.js", "dir/subdir3/a/test3a1.js"], selected)
+
+ def test_filter_temporarily_disabled_tests(self):
+ parser.parse_command_line()
+ test_file_explorer = MockTestFileExplorer()
+ test_file_explorer.tags = {
+ "dir/subdir1/test11.js": ["tag1", "tag2", "__TEMPORARILY_DISABLED__"],
+ "dir/subdir1/test12.js": ["tag3"], "dir/subdir2/test21.js": ["tag2", "tag4"]
+ }
+ config = {"roots": ["dir/subdir1/*.js", "dir/subdir2/*.js"]}
+ selected, excluded = selector.filter_tests("js_test", config, test_file_explorer)
+ self.assertEqual(["dir/subdir1/test11.js"], excluded)
+ self.assertEqual(["dir/subdir1/test12.js", "dir/subdir2/test21.js"], selected)
+
def test_jstest_force_include(self):
config = {
"roots": ["dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"],