Ejemplo n.º 1
0
    def test_change_to_blacklist_directory(self):
        git_changes = """
buildscripts/burn_in_tests.py
buildscripts/idl/file.py
buildscripts/yaml_key_value.py
        """.strip()

        with patch("builtins.open") as open_mock:
            open_mock.return_value.__enter__.return_value = git_changes.splitlines(
            )
            self.assertFalse(under_test.should_bypass_compile(MagicMock()))
    def test_change_to_blacklist_file(self):
        build_variant = "build_variant"
        git_changes = """
buildscripts/burn_in_tests.py
buildscripts/scons.py
buildscripts/yaml_key_value.py
        """.strip()

        with patch("builtins.open") as open_mock:
            open_mock.return_value.__enter__.return_value = git_changes.splitlines()
            self.assertFalse(under_test.should_bypass_compile(git_changes, build_variant))
Ejemplo n.º 3
0
    def test_change_to_only_whitelist(self):
        git_changes = """
buildscripts/burn_in_tests.py
buildscripts/yaml_key_value.py
jstests/test1.js
pytests/test2.py
        """.strip()

        with patch("builtins.open") as open_mock:
            open_mock.return_value.__enter__.return_value = git_changes.splitlines(
            )
            self.assertTrue(under_test.should_bypass_compile(MagicMock()))
    def test_change_to_etc_evergreen_that_compiles(self, get_original_mock, parse_evg_mock):
        build_variant = "build_variant"
        git_changes = """
buildscripts/burn_in_tests.py
etc/evergreen.yml
jstests/test1.js
pytests/test2.py
        """.strip()

        with patch("builtins.open") as open_mock:
            self.variant_mock(get_original_mock).expansion.return_value = "expansion 1"
            self.variant_mock(parse_evg_mock).expansion.return_value = "expansion 2"

            open_mock.return_value.__enter__.return_value = git_changes.splitlines()
            self.assertFalse(under_test.should_bypass_compile(git_changes, build_variant))
Ejemplo n.º 5
0
 def test_nothing_in_patch_file(self):
     self.assertTrue(under_test.should_bypass_compile(MagicMock()))
 def test_nothing_in_patch_file(self):
     build_variant = "build_variant"
     self.assertTrue(under_test.should_bypass_compile("", build_variant))