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

path argument to [sqlx::test] broken in 0.8.0 #3395

Closed
praseodym opened this issue Aug 1, 2024 · 3 comments · Fixed by #3403
Closed

path argument to [sqlx::test] broken in 0.8.0 #3395

praseodym opened this issue Aug 1, 2024 · 3 comments · Fixed by #3403
Labels

Comments

@praseodym
Copy link

Bug Description

The path argument to the [sqlx::test] macro seems broken in 0.8.0. cargo check reports the following error after updating from sqlx 0.7.4 to 0.8.0:

error: expected string literal
   --> src/polling_station/mod.rs:176:27
    |
176 |     #[sqlx::test(fixtures(path = "../../fixtures", scripts("elections", "polling_stations")))]
    |                           ^^^^

This code is similar to the usage documented in the [sqlx::test] docs for 0.8.0:

#[sqlx::test(fixtures(path = "./fixtures", scripts("users", "posts")))]

Info

  • SQLx version: 0.8.0
  • SQLx features enabled: ["runtime-tokio", "sqlite", "chrono"]
  • Database server and version: SQLite 3.45.0
  • Operating system: macOS 14.6
  • rustc --version: rustc 1.80.0 (051478957 2024-07-21)
@Mouwrice
Copy link

Mouwrice commented Aug 4, 2024

@praseodym, I am experiencing the same issue. I took a quick peek at the commits between v0.7.4 and v0.8.0 and found the following commit that changes code responsible for the fixtures arguments: 8f926e5
image

This possibly could have caused this regression. @saiintbrisson @abonander would you be able to shed some light on the situation?

@saiintbrisson
Copy link
Contributor

Oof, I'll take a look into this, thanks for letting me know.

@abonander
Copy link
Collaborator

There's an open PR already: #3403

abonander pushed a commit that referenced this issue Aug 26, 2024
* fix: fixture macro attribute

* remove extra new line

* add extra new line

* feat: add test for slqx::test macro

* feat: update test for sqlx::test macro

* remove old macro test

* feat: add postgres and sqlite test

* rust format

* cargo fmt

* fix fixtures execution order in test
jonner added a commit to jonner/seedcollection that referenced this issue Sep 10, 2024
0.8.1 contains a regression that prevents tests from working:
launchbadge/sqlx#3395

Signed-off-by: Jonathon Jongsma <[email protected]>
jrasanen pushed a commit to jrasanen/sqlx that referenced this issue Oct 14, 2024
* fix: fixture macro attribute

* remove extra new line

* add extra new line

* feat: add test for slqx::test macro

* feat: update test for sqlx::test macro

* remove old macro test

* feat: add postgres and sqlite test

* rust format

* cargo fmt

* fix fixtures execution order in test
jrasanen pushed a commit to jrasanen/sqlx that referenced this issue Oct 14, 2024
* fix: fixture macro attribute

* remove extra new line

* add extra new line

* feat: add test for slqx::test macro

* feat: update test for sqlx::test macro

* remove old macro test

* feat: add postgres and sqlite test

* rust format

* cargo fmt

* fix fixtures execution order in test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants