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

Can't run individual tests #1839

Closed
ccleve opened this issue Sep 4, 2024 · 3 comments
Closed

Can't run individual tests #1839

ccleve opened this issue Sep 4, 2024 · 3 comments

Comments

@ccleve
Copy link
Contributor

ccleve commented Sep 4, 2024

This might not be a bug. It might be that I just can't find the magic syntax.

cargo pgrx new foop
cd foop
cargo pgrx test

<snip>

test tests::pg_test_hello_foop ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 22.65s
cargo pgrx test test_hello_foop
Error: 
   0: Postgres `test_hello_foop` is not managed by pgrx

cargo pgrx test hello_foop 
Error: 
   0: Postgres `hello_foop` is not managed by pgrx

cargo pgrx test pg_test_hello_foop
Error: 
   0: Postgres `pg_test_hello_foop` is not managed by pgrx

cargo pgrx test tests::pg_test_hello_foop
Error: 
   0: Postgres `tests::pg_test_hello_foop` is not managed by pgrx

cargo pgrx test tests.test_hello_foop
Error: 
   0: Postgres `tests.test_hello_foop` is not managed by pgrx

I think this used to work, but I haven't tried it in a long time.

I'm using 0.12.1.

@eeeebbbbrrrr
Copy link
Contributor

you need to specify the Postgres version before the specific test name.

I’m not sure if we’ve ever been smart about this or not. I suppose we could.

@ccleve
Copy link
Contributor Author

ccleve commented Sep 5, 2024

Ayup. That did it.

If I get ambitious here, I'll fix the docs, and maybe default the pg version param, and maybe add some way of passing through switches to cargo test. Yesterday I found it very helpful to be able to add --test-threads 1. Anything else that needs doing while I'm in there?

@workingjubilee
Copy link
Member

workingjubilee commented Sep 6, 2024

and maybe add some way of passing through switches to cargo test.

typically the pattern for that is -- and then whatever else passed through after (I don't know if we currently respect that pattern)

@ccleve ccleve closed this as completed Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants