diff --git a/.github/workflows/bazel_test.yml b/.github/workflows/bazel_test.yml index 3a09c85ae..f328db599 100644 --- a/.github/workflows/bazel_test.yml +++ b/.github/workflows/bazel_test.yml @@ -95,16 +95,15 @@ jobs: if: matrix.config == 'fuzztest' run: | bazel test --build_tests_only --test_output=errors \ - -c opt --config=fuzztest //e2e_tests:all + -c opt --config=fuzztest-legacy //e2e_tests:all - name: Run end-to-end tests with --config=fuzztest-experimental if: matrix.config == 'fuzztest-experimental' - # TODO: Add other e2e tests and resolve any issues. run: | bazel test --build_tests_only --test_output=errors \ -c opt \ - --config=fuzztest-experimental --config=asan \ + --config=fuzztest \ --platform_suffix=fuzztest-experimental-asan \ - //e2e_tests:corpus_database_test + //e2e_tests:all - name: Run end-to-end tests with --config=libfuzzer if: matrix.config == 'libfuzzer' run: | diff --git a/bazel/setup_configs.sh b/bazel/setup_configs.sh index 8a6524b15..8a68aadb6 100755 --- a/bazel/setup_configs.sh +++ b/bazel/setup_configs.sh @@ -52,15 +52,27 @@ EOF cat <& non_fuzztest_flags = {}) { flags["print_subprocess_log"] = "true"; + (void)flags.try_emplace("corpus_database", ""); return RunBinary(BinaryPath(binary), RunOptions{/*flags=*/non_fuzztest_flags, /*fuzztest_flags=*/flags, @@ -1422,7 +1423,8 @@ class FuzzingModeFixtureTest case ExecutionModelParam::kTestBinary: { RunOptions run_options; run_options.fuzztest_flags = {{"fuzz", std::string(test_name)}, - {"print_subprocess_log", "true"}}; + {"print_subprocess_log", "true"}, + {"corpus_database", ""}}; run_options.env = { {"FUZZTEST_MAX_FUZZING_RUNS", absl::StrCat(iterations)}}; run_options.timeout = absl::InfiniteDuration(); @@ -1432,6 +1434,7 @@ class FuzzingModeFixtureTest RunOptions run_options; run_options.fuzztest_flags = { {"fuzz", std::string(test_name)}, + {"corpus_database", ""}, {"print_subprocess_log", "true"}, {"internal_centipede_command", ShellEscape(CentipedePath())}}; run_options.env = { @@ -1449,7 +1452,8 @@ class FuzzingModeFixtureTest {"populate_binary_info", "false"}, {"workdir", workdir.path()}, {"binary", absl::StrCat(BinaryPath(kDefaultTargetBinary), " ", - CreateFuzzTestFlag("fuzz", test_name))}, + CreateFuzzTestFlag("fuzz", test_name), " ", + CreateFuzzTestFlag("corpus_database", ""))}, {"num_runs", absl::StrCat(iterations)}}; run_options.timeout = absl::InfiniteDuration(); return RunBinary(CentipedePath(), run_options); @@ -1601,14 +1605,16 @@ class FuzzingModeCrashFindingTest {"stop_at", absl::StrCat(absl::Now() + timeout)}, {"workdir", workdir.path()}, {"binary", absl::StrCat(BinaryPath(target_binary), " ", - CreateFuzzTestFlag("fuzz", test_name))}}; + CreateFuzzTestFlag("fuzz", test_name), " ", + CreateFuzzTestFlag("corpus_database", ""))}}; run_options.env = std::move(env); run_options.timeout = timeout + absl::Seconds(10); return RunBinary(CentipedePath(), run_options); } RunOptions run_options; run_options.fuzztest_flags = {{"fuzz", std::string(test_name)}, - {"fuzz_for", absl::StrCat(timeout)}}; + {"fuzz_for", absl::StrCat(timeout)}, + {"corpus_database", ""}}; run_options.env = std::move(env); run_options.timeout = timeout + absl::Seconds(10); if (GetParam() == ExecutionModelParam::kTestBinaryInvokingCentipedeBinary) { diff --git a/e2e_tests/test_binary_util.cc b/e2e_tests/test_binary_util.cc index f20885cef..4e0e0955d 100644 --- a/e2e_tests/test_binary_util.cc +++ b/e2e_tests/test_binary_util.cc @@ -48,8 +48,7 @@ std::string GetFullPath(const std::filesystem::path& relative_path) { std::string CreateFuzzTestFlag(absl::string_view flag_name, absl::string_view flag_value) { - return absl::StrCat("--", FUZZTEST_FLAG_PREFIX, flag_name, - (flag_value.empty() ? "" : "="), flag_value); + return absl::StrCat("--", FUZZTEST_FLAG_PREFIX, flag_name, "=", flag_value); } std::string BinaryPath(const absl::string_view relative_path) {