Add other e2e tests to the GitHub action of the experimental config. This comes with fixes in the e2e tests that explicitly set corpus database to empty, which is required becuase the corpus database is not by default empty in OSS. PiperOrigin-RevId: 979250617
diff --git a/.github/workflows/bazel_test.yml b/.github/workflows/bazel_test.yml index 3a09c85..27bccb0 100644 --- a/.github/workflows/bazel_test.yml +++ b/.github/workflows/bazel_test.yml
@@ -98,13 +98,12 @@ -c opt --config=fuzztest //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 \ --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/e2e_tests/functional_test.cc b/e2e_tests/functional_test.cc index 64ecd26..943eb72 100644 --- a/e2e_tests/functional_test.cc +++ b/e2e_tests/functional_test.cc
@@ -741,6 +741,7 @@ const absl::flat_hash_map<std::string, std::string>& 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 @@ 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 @@ 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 @@ {"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 @@ {"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 f20885c..4e0e095 100644 --- a/e2e_tests/test_binary_util.cc +++ b/e2e_tests/test_binary_util.cc
@@ -48,8 +48,7 @@ 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) {