aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/cifuzz
diff options
context:
space:
mode:
Diffstat (limited to 'infra/cifuzz')
-rw-r--r--infra/cifuzz/build_fuzzers.py15
-rw-r--r--infra/cifuzz/build_fuzzers_entrypoint.py9
-rw-r--r--infra/cifuzz/build_fuzzers_test.py3
-rw-r--r--infra/cifuzz/fuzz_target.py4
-rw-r--r--infra/cifuzz/run_fuzzers_test.py4
5 files changed, 22 insertions, 13 deletions
diff --git a/infra/cifuzz/build_fuzzers.py b/infra/cifuzz/build_fuzzers.py
index 3d6c2eb1..6b6d7865 100644
--- a/infra/cifuzz/build_fuzzers.py
+++ b/infra/cifuzz/build_fuzzers.py
@@ -112,12 +112,23 @@ class Builder: # pylint: disable=too-many-instance-attributes
return True
+ def check_fuzzer_build(self):
+ """Checks the fuzzer build. Returns True on success or if config specifies
+ to skip check."""
+ if not self.config.bad_build_check:
+ return True
+
+ return check_fuzzer_build(self.config)
+
def build(self):
"""Builds the image, checkouts the source (if needed), builds the fuzzers
and then removes the unaffectted fuzzers. Returns True on success."""
methods = [
- self.build_image_and_checkout_src, self.build_fuzzers,
- self.upload_build, self.remove_unaffected_fuzz_targets
+ self.build_image_and_checkout_src,
+ self.build_fuzzers,
+ self.remove_unaffected_fuzz_targets,
+ self.check_fuzzer_build,
+ self.upload_build,
]
for method in methods:
if not method():
diff --git a/infra/cifuzz/build_fuzzers_entrypoint.py b/infra/cifuzz/build_fuzzers_entrypoint.py
index c128ae93..e8e368f1 100644
--- a/infra/cifuzz/build_fuzzers_entrypoint.py
+++ b/infra/cifuzz/build_fuzzers_entrypoint.py
@@ -42,14 +42,7 @@ def build_fuzzers_entrypoint():
config.commit_sha, config.pr_ref)
return returncode
- if not config.bad_build_check:
- # If we've gotten to this point and we don't need to do bad_build_check,
- # then the build has succeeded.
- returncode = 0
- elif build_fuzzers.check_fuzzer_build(config):
- returncode = 0
-
- return returncode
+ return 0
def main():
diff --git a/infra/cifuzz/build_fuzzers_test.py b/infra/cifuzz/build_fuzzers_test.py
index 4e0004a7..5c068ac4 100644
--- a/infra/cifuzz/build_fuzzers_test.py
+++ b/infra/cifuzz/build_fuzzers_test.py
@@ -164,6 +164,9 @@ class BuildFuzzersIntegrationTest(unittest.TestCase):
self.out_dir = os.path.join(self.workspace, 'build-out')
test_helpers.patch_environ(self)
+ base_runner_path = os.path.join(INFRA_DIR, 'base-images', 'base-runner')
+ os.environ['PATH'] = os.environ['PATH'] + os.pathsep + base_runner_path
+
def tearDown(self):
self.temp_dir_obj.cleanup()
diff --git a/infra/cifuzz/fuzz_target.py b/infra/cifuzz/fuzz_target.py
index 2a6936b0..ae92b14c 100644
--- a/infra/cifuzz/fuzz_target.py
+++ b/infra/cifuzz/fuzz_target.py
@@ -18,11 +18,11 @@ import os
import shutil
import stat
-import config_utils
-
import clusterfuzz.environment
import clusterfuzz.fuzz
+import config_utils
+
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.DEBUG)
diff --git a/infra/cifuzz/run_fuzzers_test.py b/infra/cifuzz/run_fuzzers_test.py
index 42bf0ea6..9f5f9e02 100644
--- a/infra/cifuzz/run_fuzzers_test.py
+++ b/infra/cifuzz/run_fuzzers_test.py
@@ -370,7 +370,9 @@ class CoverageReportIntegrationTest(unittest.TestCase):
commit_sha='0b95fe1039ed7c38fea1f97078316bfc1030c523',
base_commit='da0746452433dc18bae699e355a9821285d863c8',
sanitizer=self.SANITIZER,
- is_github=True)
+ is_github=True,
+ # Needed for test not to fail because of permissions issues.
+ bad_build_check=False)
self.assertTrue(build_fuzzers.build_fuzzers(build_config))
# TODO(metzman): Get rid of this here and make 'compile' do this.