Skip to content
Snippets Groups Projects
Commit fe1bcd99 authored by Matt Kwong's avatar Matt Kwong
Browse files

Remove sanity test filtering

parent 7e9bd6ca
No related branches found
No related tags found
No related merge requests found
...@@ -56,7 +56,6 @@ class TestSuite: ...@@ -56,7 +56,6 @@ class TestSuite:
# Create test suites # Create test suites
_SANITY_TEST_SUITE = TestSuite(['sanity'])
_CORE_TEST_SUITE = TestSuite(['c']) _CORE_TEST_SUITE = TestSuite(['c'])
_CPP_TEST_SUITE = TestSuite(['c++']) _CPP_TEST_SUITE = TestSuite(['c++'])
_CSHARP_TEST_SUITE = TestSuite(['csharp']) _CSHARP_TEST_SUITE = TestSuite(['csharp'])
...@@ -68,10 +67,10 @@ _RUBY_TEST_SUITE = TestSuite(['ruby']) ...@@ -68,10 +67,10 @@ _RUBY_TEST_SUITE = TestSuite(['ruby'])
_LINUX_TEST_SUITE = TestSuite(['linux']) _LINUX_TEST_SUITE = TestSuite(['linux'])
_WINDOWS_TEST_SUITE = TestSuite(['windows']) _WINDOWS_TEST_SUITE = TestSuite(['windows'])
_MACOS_TEST_SUITE = TestSuite(['macos']) _MACOS_TEST_SUITE = TestSuite(['macos'])
_ALL_TEST_SUITES = [_SANITY_TEST_SUITE, _CORE_TEST_SUITE, _CPP_TEST_SUITE, _ALL_TEST_SUITES = [_CORE_TEST_SUITE, _CPP_TEST_SUITE, _CSHARP_TEST_SUITE,
_CSHARP_TEST_SUITE, _NODE_TEST_SUITE, _OBJC_TEST_SUITE, _NODE_TEST_SUITE, _OBJC_TEST_SUITE, _PHP_TEST_SUITE,
_PHP_TEST_SUITE, _PYTHON_TEST_SUITE, _RUBY_TEST_SUITE, _PYTHON_TEST_SUITE, _RUBY_TEST_SUITE, _LINUX_TEST_SUITE,
_LINUX_TEST_SUITE, _WINDOWS_TEST_SUITE, _MACOS_TEST_SUITE] _WINDOWS_TEST_SUITE, _MACOS_TEST_SUITE]
# Dictionary of whitelistable files where the key is a regex matching changed files # Dictionary of whitelistable files where the key is a regex matching changed files
# and the value is a list of tests that should be run. An empty list means that # and the value is a list of tests that should be run. An empty list means that
...@@ -90,7 +89,7 @@ _WHITELIST_DICT = { ...@@ -90,7 +89,7 @@ _WHITELIST_DICT = {
'^src/php/': [_PHP_TEST_SUITE], '^src/php/': [_PHP_TEST_SUITE],
'^src/python/': [_PYTHON_TEST_SUITE], '^src/python/': [_PYTHON_TEST_SUITE],
'^src/ruby/': [_RUBY_TEST_SUITE], '^src/ruby/': [_RUBY_TEST_SUITE],
'^templates/': [_SANITY_TEST_SUITE], '^templates/': [],
'^test/core/': [_CORE_TEST_SUITE], '^test/core/': [_CORE_TEST_SUITE],
'^test/cpp/': [_CPP_TEST_SUITE], '^test/cpp/': [_CPP_TEST_SUITE],
'^test/distrib/cpp/': [_CPP_TEST_SUITE], '^test/distrib/cpp/': [_CPP_TEST_SUITE],
......
...@@ -40,7 +40,7 @@ sys.path.insert(0, os.path.abspath('tools/run_tests/')) ...@@ -40,7 +40,7 @@ sys.path.insert(0, os.path.abspath('tools/run_tests/'))
from run_tests_matrix import _create_test_jobs, _create_portability_test_jobs from run_tests_matrix import _create_test_jobs, _create_portability_test_jobs
import filter_pull_request_tests import filter_pull_request_tests
_LIST_OF_LANGUAGE_LABELS = ['sanity', 'c', 'c++', 'csharp', 'node', 'objc', 'php', 'php7', 'python', 'ruby'] _LIST_OF_LANGUAGE_LABELS = ['c', 'c++', 'csharp', 'node', 'objc', 'php', 'php7', 'python', 'ruby']
_LIST_OF_PLATFORM_LABELS = ['linux', 'macos', 'windows'] _LIST_OF_PLATFORM_LABELS = ['linux', 'macos', 'windows']
class TestFilteringTest(unittest.TestCase): class TestFilteringTest(unittest.TestCase):
...@@ -65,6 +65,19 @@ class TestFilteringTest(unittest.TestCase): ...@@ -65,6 +65,19 @@ class TestFilteringTest(unittest.TestCase):
print print
filtered_jobs = filter_pull_request_tests.filter_tests(all_jobs, "test") filtered_jobs = filter_pull_request_tests.filter_tests(all_jobs, "test")
# Make sure sanity tests aren't being filtered out
sanity_tests_in_all_jobs = 0
sanity_tests_in_filtered_jobs = 0
for job in all_jobs:
if "sanity" in job.labels:
sanity_tests_in_all_jobs += 1
all_jobs = [job for job in all_jobs if "sanity" not in job.labels]
for job in filtered_jobs:
if "sanity" in job.labels:
sanity_tests_in_filtered_jobs += 1
filtered_jobs = [job for job in filtered_jobs if "sanity" not in job.labels]
self.assertEquals(sanity_tests_in_all_jobs, sanity_tests_in_filtered_jobs)
for label in labels: for label in labels:
for job in filtered_jobs: for job in filtered_jobs:
self.assertNotIn(label, job.labels) self.assertNotIn(label, job.labels)
...@@ -82,8 +95,6 @@ class TestFilteringTest(unittest.TestCase): ...@@ -82,8 +95,6 @@ class TestFilteringTest(unittest.TestCase):
# Changing core should trigger all tests # Changing core should trigger all tests
self.test_filtering(['src/core/foo.bar'], [_LIST_OF_LANGUAGE_LABELS]) self.test_filtering(['src/core/foo.bar'], [_LIST_OF_LANGUAGE_LABELS])
# Testing individual languages # Testing individual languages
self.test_filtering(['templates/foo.bar'], [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
filter_pull_request_tests._SANITY_TEST_SUITE.labels])
self.test_filtering(['test/core/foo.bar'], [label for label in _LIST_OF_LANGUAGE_LABELS if label not in self.test_filtering(['test/core/foo.bar'], [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
filter_pull_request_tests._CORE_TEST_SUITE.labels]) filter_pull_request_tests._CORE_TEST_SUITE.labels])
self.test_filtering(['src/cpp/foo.bar'], [label for label in _LIST_OF_LANGUAGE_LABELS if label not in self.test_filtering(['src/cpp/foo.bar'], [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
...@@ -102,9 +113,9 @@ class TestFilteringTest(unittest.TestCase): ...@@ -102,9 +113,9 @@ class TestFilteringTest(unittest.TestCase):
filter_pull_request_tests._RUBY_TEST_SUITE.labels]) filter_pull_request_tests._RUBY_TEST_SUITE.labels])
def test_combined_language_filters(self): def test_combined_language_filters(self):
self.test_filtering(['templates/foo.bar', 'test/core/foo.bar'], self.test_filtering(['src/cpp/foo.bar', 'test/core/foo.bar'],
[label for label in _LIST_OF_LANGUAGE_LABELS if label not in [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
filter_pull_request_tests._SANITY_TEST_SUITE.labels and label not in filter_pull_request_tests._CPP_TEST_SUITE.labels and label not in
filter_pull_request_tests._CORE_TEST_SUITE.labels]) filter_pull_request_tests._CORE_TEST_SUITE.labels])
self.test_filtering(['src/node/foo.bar', 'src/cpp/foo.bar', "src/csharp/foo.bar"], self.test_filtering(['src/node/foo.bar', 'src/cpp/foo.bar', "src/csharp/foo.bar"],
[label for label in _LIST_OF_LANGUAGE_LABELS if label not in [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment