sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

#[sqlx::test] should play nicely with nextest

Open DanielJoyce opened this issue 3 years ago • 5 comments

Is your feature request related to a problem? Please describe. Currently running tests annotated with #[sqlx::test] fail with nextest because of how sqlx sets up test dbs, and nextest starts multiple test binaries in parallel to speed up tests

Nextest has real nice reporting features.

Describe the solution you'd like I can use #[sqlx::test] with nextest

Describe alternatives you've considered None, because the test binary that has a #[sqlx::test] in it deletes the db on exit, stomping on the next invocation of the binary by nextest

DanielJoyce avatar Sep 28 '22 15:09 DanielJoyce

This sounds like a relatively simple thing to implement—though I say this without having looked at the source code. Is the reason it has been delayed for so long that few people actually care about it, or do the maintainers disapprove of the change?

If it's the latter, it could be put behind a "nextest" feature flag.

dsaghliani avatar Mar 16 '23 14:03 dsaghliani

Currently using cargo nextest run --retries 1 as a workaround to this, but the tests that initially failed will be reported as flaky.

RigoOnRails avatar Mar 26 '23 04:03 RigoOnRails

Unfortunately cargo nextest run --retries 1 is not deterministic and thus not stable for any use in CI ...

khorchanov avatar Jun 02 '23 15:06 khorchanov

Some discussion in https://github.com/launchbadge/sqlx/pull/2640#issuecomment-1659455042

abonander avatar Aug 01 '23 02:08 abonander

Since #2640 is merged is there any progress on this Issue?

DerPlayer2001 avatar Jan 16 '24 09:01 DerPlayer2001