Repository navigation
Conversation
The test harness used DATABASE_URL and ignored common.database-url-var in sqlx.toml. TestSupport::cleanup_test_dbs now takes the variable name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Does your PR solve an issue?
It partially closes #3947. Instead of adding a new arg to the macro, with the recently added sqlx.toml support, we now use
sqlx.tomland honordatabase-url-varin tests using#[sqlx::test].TestArgsgainsdatabase_url_varinjected by the macro.This new functionality is covered by tests.
cleanup_test_dbsnow also takes adatabase_url_var. It appears to be unused here but third party implementations might want to align this with the settings of thesqlx.toml.Is this a breaking change?
Yes.
From a Rust API view, this is a breaking change because we changed the signature of
cleanup_test_dbs.But considering we now honor a new setting in a file in test macros, the other changes are also breaking changes.
So this probably needs to wait for 0.10.0.
I only found time now to update to sqlx 0.9 and wasn't able to test out any pre-release. I think it would be good to release 0.10 with this change soonish, because I think it was an oversight landing
sqlx.tomlwithout support for it in#[sqlx::test].