-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow using cargo nextest
for running tests
#13045
Conversation
// nextest parses stdout | ||
if options.list { | ||
eprintln!("NOTICE: --list option unsupported quitting"); | ||
return Ok(()); |
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.
why Ok?
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.
Because if it returns an error, cargo nextest
aborts immediately
What is happening I think is that nextest
lists all possible commands first (by running cargo test ... --list --format terse
) and then uses that output to determine what is subsequently run.
So if the --list
part returns an error then none of the tests run
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.
Added some comments in fd15523
Co-authored-by: Piotr Findeisen <[email protected]>
// return Ok, not error so that tools like nextest which are listing all | ||
// workspace tests (by running `cargo test ... --list --format terse`) | ||
// do not fail when they encounter this binary. Instead, print nothing | ||
// to stdout and return OK so they can continue listing other tests. |
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.
❤️
a very good explanation
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.
👍
if |
That is an excellent question One way to do this would be to use nextest to run the tests, which might improve the CI speed (though we would have to pay for the time to build/install nextest itself) -- we actually do this in influxdb_iox and it works pretty well. In general I assume this is a developer convenience for a small number of developers, if it breaks as part of a subsequent PR we can also always fix it again and it won't affect other PRs. If these assumptions turn out to be untrue, we should reasses. Thus in my opinion adding adding a CI test would impose a burden that is not commensurate with the value that would be gained |
Thanks @findepi and @jayzhan211 for the reviews |
Co-authored-by: Piotr Findeisen <[email protected]>
…nto alamb/support-nextest
so
|
I don't think this is necessary / good to try and push. I think allowing developers the freedom to use whatever tools they deem best is better than trying to require one particular toolset
TLDR is we make sure all our tests are isolated / don't use global state -- which takes quite a bit of finagling when it involves subprocesses / end to end type tests. |
Thank you again @findepi and @jayzhan211 for your helpful comments |
Would this be worthy of adding to https://github.com/apache/datafusion/blob/main/docs/source/contributor-guide/testing.md ? |
Yes, totally -- proposed change in #13160 |
Which issue does this PR close?
Closes #13044
Rationale for this change
I want to use cargo nextest: https://nexte.st/ is a faster way to run tests
I want to run like this
But that errors as explained on #13044
What changes are included in this PR?
sqllogictests
test runner so it doesn't interfere withnextest
Are these changes tested?
Yes, by CI
I also ran it manually and I can now run the entire test suite (other than sqllogictest) in 30s keeping all cores busy
(venv) andrewlamb@Andrews-MacBook-Pro-2:~/Software/datafusion$ cargo nextest run ... PASS [ 3.946s] datafusion-physical-expr-common binary_map::tests::test_string_overflow PASS [ 27.468s] datafusion::fuzz fuzz_cases::equivalence::projection::ordering_satisfy_after_projection_random ------------ Summary [ 29.137s] 5349 tests run: 5349 passed, 11 skipped
Are there any user-facing changes?
No this is a developer change