-
Notifications
You must be signed in to change notification settings - Fork 40
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
Run cargo nextest
in addition to cargo test
in CI
#788
Conversation
Ok |
62077ad
to
7d0e33b
Compare
Hi there, author of nextest here! I think your problem can be solved with nextest by passing in Using pre-built binaries in GHA is also super easy these days if it helps: https://nexte.st/book/pre-built-binaries.html#using-pre-built-binaries-in-ci Happy to answer any other questions you might have -- glad you're trying it out :) |
@sunshowers thank you! A bunch of us have already been using nextest locally and love it. |
Using the GH action to get the nextest binary takes 0s. So that's good. |
cargo test
with cargo-nextest in CI
085c16d
to
d941113
Compare
failure-output = "immediate-final" | ||
|
||
[profile.ci.junit] | ||
path = "junit.xml" |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
# Conflicts: # .github/workflows/rust.yml
This reverts commit 720c55c.
d71595e
to
d4ce216
Compare
@@ -100,7 +100,7 @@ async fn test_sessions(cptestctx: &ControlPlaneTestContext) { | |||
.await | |||
.expect("failed to get 401 for unauthed API request"); | |||
|
|||
RequestBuilder::new(&testctx, Method::GET, "/orgs/whatever") | |||
RequestBuilder::new(&testctx, Method::GET, "/orgs/nonexistent") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forcing tests to run. the run deduper thing is driving me nuts
e01f201
to
2e63a62
Compare
2e63a62
to
c5ebb72
Compare
Some issues came up in chat. @davepacheco points out that fully changing over to nextest in CI effectively means we are deciding nextest is authoritative, i.e., if For this reason, I'm updating the PR to add separate jobs (well, matrix options on the same job) that run the tests with nextest. This lets us see how often the two test runners give different results, as well as compare output in the case of failures. We can use the generated name of the jobs to keep only The required checks would have to be changed in the repo settings to include
|
cargo test
with cargo-nextest in CIcargo nextest
in addition to cargo test
in CI
f758507
to
6b0c970
Compare
# end without also grabbing random other temporary files. | ||
run: | | ||
TMPDIR=$OMICRON_TMP PATH="$PATH:$PWD/out/cockroachdb/bin:$PWD/out/clickhouse" RUSTFLAGS="-D warnings" RUSTDOCFLAGS="-D warnings" \ | ||
cargo build --locked --all-targets --verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could skip the cargo build
step here, but that might make it harder to tell at a glance when the results of these two jobs diverge
Can we add an analogous clone of the buildomat job to run nextest there also? |
Amazingly, it worked on the first try. |
The files in question have changed enough that we'll want to start this from scratch. I still think it would be nice to get dramatically better failure output from CI. |
cargo-nextest is a new Rust test runner. Imagine a world where you can actually tell what tests failed by looking at the CI output. That world is... this world.
As discussed in the comment below, we want to compare nextest and
cargo test
results for a while without committing to makingcargo nextest
results authoritative, so this adds a job that is not required to pass for PRs to get merged. Most of the time the two runners should have the same result, but we want to see if that's really true.Closes #787.
Advantages for CI
failure-output = "immediate-final"
causes failures to be printed when they happen and again at the end so you can see what failed without scrollingIn theory it should run the test suite a bit faster too, but I haven't be able to tell whether we're getting a speedup because the times vary so much.
Risks
cargo test
My sense is these are small risks and the project is pretty reliable and stable, but I would want input from people who have a better feel for the ecosystem and what people are using. I believe some of us are using it locally already.
What this PR does
Add a job
build-and-nextest
that does the following:cargo-nextest
cargo-nextest
as the test runner for the CI test jobcargo-nextest
produce JUnit outputExample failure output
Note that the failure is at the bottom of the output.