-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
v0.2.3 issues #285
Comments
Let me see if I can reproduce this issue with a very small example. |
Ya know what, I just figured this out. the "test" modules need a #[cfg(any(test, feature = "pg_test"))]
#[pgx_macros::pg_schema]
mod tests {
use crate::query_dsl::bool::dsl::*;
use crate::zdbquery::ZDBQuery;
use pgx::*;
use serde_json::json;
// do #[pg_test] functions here
} |
So I completely uninstalled rust, cargo, and pgx, did a clean install, and did a clean "cargo pgx new compiletest", then "cd compiletest", "cargo pgx test pg13". Everything worked fine. I added a new mod and a new test, and it still worked fine. I went back to my main project, tried to run cargo pgx test pg13, and got this: I'm going to start systematically copying code from the main project to compiletest to see what the difference is. (And by the way: compile times are still over 30 seconds. I may temporarily downgrade just to get past that problem.) |
I wonder if your Cargo.toml is wrong. Can you paste it here? |
[package] [lib] [features] [dependencies] [dev-dependencies] [profile.dev] [profile.release] |
That looks good. hmm |
perhaps b/c of all the uninstall/install you did, you need a |
I copied most of the main project code to compiletest, and it still works fine. Tried "cargo clean" on the main project and it still fails in the same way. Will keep copying code until I find the difference... |
To clarify, that's the Cargo.toml from the crate that's failing, right? |
Yes. Kestrel fails, compiletest succeeds. |
try this:
I wonder if your |
Bingo. At some point along the way I deleted the .cargo directory, but maybe not recently enough. Is there some way to do some caching or something to speed up tests?
(I'll open a new ticket if that helps.) |
A new ticket about compilation & schema-gen perf would be best. I'll close this issue as it looks like you're back in action... |
I happened to upgrade to 0.2.2 earlier today, and 0.2.3 just now. I forced an upgrade to cargo-pgx 0.2.3, built a new, clean app using cargo pgx new, and then copied over the code and [dependencies] section of the cargo.toml. I'm having these issues:
It's way slower than before to run tests. In particular, Building [=====> ] sql_generator(bin) is really slow. What took only a few seconds before now costs 31 seconds (on a really small toy app).
cargo pgx run pg13
is also slow to start.The sample test in lib.rs, test_hello_kestrel(), runs fine. A test in a separate module, however, does not.
It fails at: SELECT "tests"."a_small_test"();
function tests.a_small_test() does not exist
Here is the output in all its glory:
The text was updated successfully, but these errors were encountered: