diff options
-rw-r--r-- | buildscripts/resmokelib/selector.py | 2 | ||||
-rw-r--r-- | buildscripts/tests/resmokelib/test_selector.py | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/buildscripts/resmokelib/selector.py b/buildscripts/resmokelib/selector.py index 68fa18a0324..b9f5686df8b 100644 --- a/buildscripts/resmokelib/selector.py +++ b/buildscripts/resmokelib/selector.py @@ -165,7 +165,7 @@ class _TestList(object): else: if not self._test_file_explorer.isfile(test): raise ValueError("Unrecognized test file: {}".format(test)) - expanded_tests.append(test) + expanded_tests.append(os.path.normpath(test)) return expanded_tests def include_files(self, include_files, force=False): diff --git a/buildscripts/tests/resmokelib/test_selector.py b/buildscripts/tests/resmokelib/test_selector.py index 852272aecee..639d6f74ea6 100644 --- a/buildscripts/tests/resmokelib/test_selector.py +++ b/buildscripts/tests/resmokelib/test_selector.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import fnmatch +import os.path import unittest import buildscripts.resmokelib.parser as parser @@ -168,6 +169,14 @@ class TestTestList(unittest.TestCase): self.assertEqual(roots, selected) self.assertEqual([], excluded) + def test_roots_normpath(self): + roots = ["dir/a/abc.js", "dir/b/xyz.js"] + test_list = selector._TestList(self.test_file_explorer, roots, tests_are_files=False) + selected, excluded = test_list.get_tests() + for root_file, selected_file in zip(roots, selected): + self.assertEqual(os.path.normpath(root_file), selected_file) + self.assertEqual([], excluded) + def test_roots_with_glob(self): glob_roots = ["dir/subdir1/*.js"] expected_roots = ["dir/subdir1/test11.js", "dir/subdir1/test12.js"] @@ -563,7 +572,7 @@ class TestFilterTests(unittest.TestCase): selected) self.assertEqual(["dir/subdir2/test21.js"], excluded) - def test_json_shcema_include_files(self): + def test_json_schema_include_files(self): config = { "roots": ["dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"], "include_files": ["dir/subdir2/test21.js"] |