diff options
author | 2021-06-30 07:34:42 -0700 | |
---|---|---|
committer | 2021-06-30 07:34:42 -0700 | |
commit | 0672aa4e1f2cc332f6e6a020259c35007292cd91 (patch) | |
tree | d3a6dee092ff2722c5f9e28de1d21b652026092c /infra/cifuzz/generate_coverage_report_test.py | |
parent | a9c49afb784f0deaaffba8b388333c36074550c2 (diff) |
[CIFuzz] Don't make everything a subdirectory of /out (#5970)
Use different subdirectories of workspace for builds, old builds, coverage reports, corpora and artifacts/testscases.
Diffstat (limited to 'infra/cifuzz/generate_coverage_report_test.py')
-rw-r--r-- | infra/cifuzz/generate_coverage_report_test.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/infra/cifuzz/generate_coverage_report_test.py b/infra/cifuzz/generate_coverage_report_test.py index 461cd7ca..250d9594 100644 --- a/infra/cifuzz/generate_coverage_report_test.py +++ b/infra/cifuzz/generate_coverage_report_test.py @@ -30,17 +30,20 @@ class TestRunCoverageCommand(unittest.TestCase): @mock.patch('helper.docker_run') def test_run_coverage_command(self, mocked_docker_run): # pylint: disable=no-self-use """Tests that run_coverage_command works as intended.""" + config = test_helpers.create_run_config(project_name=PROJECT, + sanitizer=SANITIZER) + workspace = test_helpers.create_workspace() expected_docker_args = [ '--cap-add', 'SYS_PTRACE', '-e', 'FUZZING_ENGINE=libfuzzer', '-e', 'ARCHITECTURE=x86_64', '-e', 'CIFUZZ=True', '-e', - f'SANITIZER={SANITIZER}', '-e', 'FUZZING_LANGUAGE=c++', '-v', - f'{OUT_DIR}:/out', '-e', 'COVERAGE_EXTRA_ARGS=', '-e', 'HTTP_PORT=', - '-t', 'gcr.io/oss-fuzz-base/base-runner', 'coverage' + f'SANITIZER={SANITIZER}', '-e', 'FUZZING_LANGUAGE=c++', '-e', + 'OUT=/workspace/build-out', '-v', + f'{workspace.workspace}:{workspace.workspace}', '-e', + 'COVERAGE_EXTRA_ARGS=', '-e', 'HTTP_PORT=', '-t', + 'gcr.io/oss-fuzz-base/base-runner', 'coverage' ] - config = test_helpers.create_run_config(project_name=PROJECT, - sanitizer=SANITIZER) - generate_coverage_report.run_coverage_command(OUT_DIR, config) + generate_coverage_report.run_coverage_command(workspace, config) mocked_docker_run.assert_called_with(expected_docker_args) @@ -51,10 +54,7 @@ class DownloadCorporaTest(unittest.TestCase): """Tests that download_corpora works as intended.""" clusterfuzz_deployment = mock.Mock() fuzz_target_paths = ['/path/to/fuzzer1', '/path/to/fuzzer2'] - expected_calls = [ - mock.call('fuzzer1', OUT_DIR), - mock.call('fuzzer2', OUT_DIR) - ] - generate_coverage_report.download_corpora(OUT_DIR, fuzz_target_paths, + expected_calls = [mock.call('fuzzer1'), mock.call('fuzzer2')] + generate_coverage_report.download_corpora(fuzz_target_paths, clusterfuzz_deployment) clusterfuzz_deployment.download_corpus.assert_has_calls(expected_calls) |