[infra] Mark more tests as integration (#4869)

This commit is contained in:
jonathanmetzman 2020-12-18 10:44:12 -08:00 committed by GitHub
parent c2165341d2
commit d8546a88b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 7 deletions

View File

@ -36,6 +36,8 @@ import test_repos
# pylint: enable=wrong-import-position
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
'INTEGRATION_TESTS=1 not set')
class DetectRepoIntegrationTest(unittest.TestCase):
"""Class to test the functionality of the detect_repo module."""

View File

@ -31,8 +31,10 @@ import test_repos
TEST_DIR_PATH = os.path.dirname(os.path.realpath(__file__))
class BuildImageIntegrationTests(unittest.TestCase):
"""Testing if an image can be built from different states e.g. a commit."""
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
'INTEGRATION_TESTS=1 not set')
class BuildImageIntegrationTest(unittest.TestCase):
"""Tests if an image can be built from different states e.g. a commit."""
@unittest.skip('Test is failing (spuriously?).')
def test_build_fuzzers_from_commit(self):
@ -48,8 +50,8 @@ class BuildImageIntegrationTests(unittest.TestCase):
host_src_dir = build_specified_commit.copy_src_from_docker(
test_case.project_name, tmp_dir)
test_repo_manager = repo_manager.RepoManager(
test_case.git_url, host_src_dir, repo_name=test_case.oss_repo_name)
test_repo_manager = repo_manager.clone_and_get_manager(
test_case.git_url, host_src_dir, test_case.oss_repo_name)
build_data = build_specified_commit.BuildData(
sanitizer='address',
architecture='x86_64',

View File

@ -37,11 +37,13 @@ def get_oss_fuzz_repo():
yield os.path.join(tmp_dir, repo_name)
class CloneIntegrationTest(unittest.TestCase):
class CloneTest(unittest.TestCase):
"""Tests the _clone function."""
def test_clone_valid_repo(self):
"""Tests the correct location of the git repo."""
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
'INTEGRATION_TESTS=1 not set')
def test_clone_valid_repo_integration(self):
"""Integration test that tests the correct location of the git repo."""
with get_oss_fuzz_repo() as oss_fuzz_repo:
git_path = os.path.join(oss_fuzz_repo, '.git')
self.assertTrue(os.path.isdir(git_path))
@ -54,6 +56,8 @@ class CloneIntegrationTest(unittest.TestCase):
'oss-fuzz')
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
'INTEGRATION_TESTS=1 not set')
class RepoManagerCheckoutTest(unittest.TestCase):
"""Tests the checkout functionality of RepoManager."""
@ -77,6 +81,8 @@ class RepoManagerCheckoutTest(unittest.TestCase):
repo_man.checkout_commit('not-a-valid-commit')
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
'INTEGRATION_TESTS=1 not set')
class RepoManagerGetCommitListTest(unittest.TestCase):
"""Tests the get_commit_list method of RepoManager."""
@ -110,6 +116,8 @@ class RepoManagerGetCommitListTest(unittest.TestCase):
repo_man.get_commit_list(old_commit, new_commit) # pylint: disable=arguments-out-of-order
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
'INTEGRATION_TESTS=1 not set')
class GitDiffTest(unittest.TestCase):
"""Tests get_git_diff."""
@ -149,6 +157,8 @@ class GitDiffTest(unittest.TestCase):
self.assertIsNone(diff)
@unittest.skipIf(not os.getenv('INTEGRATION_TESTS'),
'INTEGRATION_TESTS=1 not set')
class CheckoutPrIntegrationTest(unittest.TestCase):
"""Does Integration tests on the checkout_pr method of RepoManager."""