Skip to content

Commit

Permalink
ci: no retry for flakes in coverage builds (#12752)
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan authored Sep 28, 2023
1 parent 6ed7976 commit da7cecd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ci/cloudbuild/builds/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ bazel coverage "${args[@]}" --test_tag_filters=-integration-test ...

GOOGLE_CLOUD_CPP_SPANNER_SLOW_INTEGRATION_TESTS="instance"
mapfile -t integration_args < <(integration::bazel_args)
# With code coverage the `--flaky_test_attempts` flag works in unexpected ways.
# A flake produces an empty `coverage.dat` file, which breaks the build when
# trying to consolidate all the `coverage.dat` files.
#
# This combination of a "successful" test (because the flake is retried) and a
# failure in the consolidation of coverage results, which happens much later
# in the build, easily leads the developer astray.
i=0
for arg in "${integration_args[@]}"; do
case "${arg}" in
--flaky_test_attempts=*)
unset "integration_args[$i]"
;;
esac
i=$((++i))
done
integration::bazel_with_emulators coverage "${args[@]}" "${integration_args[@]}"

# Where does this token come from? For triggered ci/pr builds GCB will securely
Expand Down

0 comments on commit da7cecd

Please sign in to comment.