Closed funlennysub closed 1 month ago
Currently if you run cargo test
in root directory with no features it will complain about examples
not having bigquery, I'm not sure how to make it only compile the example if you have the feature enabled
Currently if you run
cargo test
in root directory with no features it will complain aboutexamples
not having bigquery, I'm not sure how to make it only compile the example if you have the feature enabled
Adding the following to the pg_replicate
's Cargo.toml
should fix this:
[[example]]
name = "bigquery"
required-features = ["bigquery"]
[[example]]
name = "duckdb"
required-features = ["duckdb"]
Will try later. Also, do you want me to test code twice, with and without features?
do you want me to test code twice, with and without features?
If you mean the two separate steps "Run api tests" and "Run non-api tests", they are separate because api tests need a running Postgres, while the others don't. Leave them as they are now (i.e. --all-features should be only on "Run non-api tests").
I mostly meant the non-api tests
to be ran with --no-default-features
and --all-features
cargo test --workspace --all-features --exclude api
should be fine for now.
This shouldn't be a problem but if you run cargo run --example bigquery
from repository root, it will run the example without asking for a feature, unlike duckdb, but if ran from pg_replicate
crate it won't run and say you need a feature enabled. Other than that everything works as expected.
That's a bit weird. Maybe a cargo quirk. Not a big deal though, if we run the example with cargo run -p pg_replicate --example <example_name> --features="<example_name>"
it works fine. I'll update the README with this. Merging it now. Thanks for the PR.
What kind of change does this PR introduce?
Implement #25