Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build/roachtest: do not exit with code 11 on cluster creation failure #109463

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions build/teamcity-roachtest-invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ bin/roachtest run \
code=$?
set -e

if [[ ${code} -eq 10 ]]; then
# Exit code 10 indicates that some tests failed, but that roachtest
# as a whole passed. We want to exit zero in this case so that we
# can let TeamCity report failing tests without also failing the
# build. That way, build failures can be used to notify about serious
# problems that prevent tests from being invoked in the first place.
if [[ ${code} == 10 || ${code} == 11 ]]; then
# Exit code 10 indicates that some tests failed; exit code 11
# indicates that cluster creation failed for some test in the
# run. In both cases, roachtest as a whole passed. We want to exit
# zero in this case so that we can let TeamCity report failing tests
# without also failing the build. That way, build failures can be
# used to notify about serious problems that prevent tests from
# being invoked in the first place (typically exit code 1).
code=0
fi

Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/roachtest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ import (
"github.com/spf13/pflag"
)

// Note that the custom exit codes below are not exposed when running
// roachtest on TeamCity. See `teamcity-roachtest-invoke.sh` for more
// details. Also, if the exit codes here change, they need to updated
// on that script accordingly.

// ExitCodeTestsFailed is the exit code that results from a run of
// roachtest in which the infrastructure worked, but at least one
// test failed.
Expand Down