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

set pipefail option when running tests #1600

Merged
merged 1 commit into from
Feb 22, 2024
Merged

set pipefail option when running tests #1600

merged 1 commit into from
Feb 22, 2024

Conversation

tgummerer
Copy link
Contributor

When running the tests in CI, we're piping the output of go test into gotestfmt to get prettier output. This works because gotestfmt will return a non-zero exit code when there are test failures.

However when there are other failures, e.g. compilation of the tests failed, gotestfmt will have a 0 exit code. go test wouldn't, but because we're piping the results through, the shell swallows that unless we're setting the pipefail option.

Set up the pipefail option here, so tests aren't accidentally green when compilation fails.

/cc @thomas11 who noticed the tests were passing even though compilation failed in #1595

When running the tests in CI, we're piping the output of `go test`
into gotestfmt to get prettier output.  This works because `gotestfmt`
will return a non-zero exit code when there are test failures.

However when there are other failures, e.g. compilation of the tests
failed, `gotestfmt` will have a 0 exit code.  `go test` wouldn't, but
because we're piping the results through, the shell swallows that
unless we're setting the pipefail option.

Set up the pipefail option here, so tests aren't accidentally green
when compilation fails.
Copy link
Contributor

@thomas11 thomas11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick fix!

We should probably do a systematic review of Pulumi usages of gotestfmt without pipefail....

@tgummerer tgummerer merged commit 549157f into master Feb 22, 2024
51 checks passed
@tgummerer tgummerer deleted the tg/pipefail branch February 22, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants