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

test: Run trycmd tests with RUST_BACKTRACE=0 #2242

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

szokeasaurusrex
Copy link
Member

@szokeasaurusrex szokeasaurusrex commented Nov 8, 2024

Some of our trycmd tests assume that no backtrace is printed in the test commands output, even when an error is supposed to occur. RUST_BACKTRACE=0 appears to be set in CI, but this becomes a problem running tests locally, where tests sometimes fail when the local environmnent has RUST_BACKTRACE=1.

Note that backtraces are still logged tracing back to the error that caused the test failure. But, if we are testing that a specific command which we expect to fail has a certain output, this change ensures that regardless of the outside environment, we don't get a backtrace in the test output, as this could fail the test.

Some of our `trycmd` tests assume that no backtrace is printed in the test commands output, even when an error is supposed to occur. `RUST_BACKTRACE=0` appears to be set in CI, but this becomes a problem running tests locally, where tests sometimes fail when the local environmnent has `RUST_BACKTRACE=0`.

Note that backtraces are still logged tracing back to the error that caused the test failure. But, if we are testing that a specific command which we expect to fail has a certain output, this change ensures that regardless of the outside environment, we don't get a backtrace _in the test output_, as this could fail the test.
@szokeasaurusrex szokeasaurusrex merged commit 372adeb into master Nov 8, 2024
14 checks passed
@szokeasaurusrex szokeasaurusrex deleted the szokeasaurusrex/run-tests-rust-backtrace-0 branch November 8, 2024 15:44
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.

2 participants