aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/cifuzz/fuzz_target_test.py
diff options
context:
space:
mode:
authorGravatar jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>2021-05-26 09:45:22 -0700
committerGravatar GitHub <noreply@github.com>2021-05-26 09:45:22 -0700
commit8c4ad095e93d2d2909a762ed920b174926700177 (patch)
treed9308c318c5fc50cae6a8df650a697468c72949a /infra/cifuzz/fuzz_target_test.py
parent8d313798ab2a2ae4d1388fd2cbcbe38028b69b67 (diff)
[CIFuzz] Refactor in preparation for filestore (#5841)
1. Moving the _create_config and create_config functions from build_fuzzers_test.py and run_fuzzers_test.py into test_helpers.py (which is now part of cifuzz instead of infra) and share code between them. 2. Rename artifacts_dir to crashes_dir in run_fuzzers.py. "artifacts" is ambiguous. 3. Make some small changes to pytest.ini to improve debugging.
Diffstat (limited to 'infra/cifuzz/fuzz_target_test.py')
-rw-r--r--infra/cifuzz/fuzz_target_test.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/infra/cifuzz/fuzz_target_test.py b/infra/cifuzz/fuzz_target_test.py
index 8bec234d..22c5ac83 100644
--- a/infra/cifuzz/fuzz_target_test.py
+++ b/infra/cifuzz/fuzz_target_test.py
@@ -22,8 +22,8 @@ import parameterized
from pyfakefs import fake_filesystem_unittest
import clusterfuzz_deployment
-import config_utils
import fuzz_target
+import test_helpers
# NOTE: This integration test relies on
# https://github.com/google/oss-fuzz/tree/master/projects/example project.
@@ -48,16 +48,7 @@ def _create_config(**kwargs):
if default_key not in kwargs:
kwargs[default_key] = default_value
- with mock.patch('os.path.basename', return_value=None), mock.patch(
- 'config_utils.get_project_src_path',
- return_value=None), mock.patch('config_utils._is_dry_run',
- return_value=True):
- config = config_utils.RunFuzzersConfig()
-
- for key, value in kwargs.items():
- assert hasattr(config, key), 'Config doesn\'t have attribute: ' + key
- setattr(config, key, value)
- return config
+ return test_helpers.create_run_config(**kwargs)
def _create_deployment(**kwargs):