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

cargo test fails locally #812

Closed
hamirmahal opened this issue Sep 5, 2024 · 3 comments
Closed

cargo test fails locally #812

hamirmahal opened this issue Sep 5, 2024 · 3 comments
Assignees

Comments

@hamirmahal
Copy link
Contributor

I've been trying to run cargo test locally but it fails with

   Compiling sea-query v0.32.0-rc.1 (/home/hamir/sea-query)
error[E0433]: failed to resolve: use of undeclared crate or module `pgvector`
    --> tests/postgres/query.rs:2121:57
     |
2121 |                 Expr::col(Char::Character).eq(Expr::val(pgvector::Vector::from(vec![1.0, 2.0])))
     |                                                         ^^^^^^^^ use of undeclared crate or module `pgvector`
     |
help: there is an enum variant `crate::ColumnType::Vector` and 1 other; try using the variant's enum
     |
2121 |                 Expr::col(Char::Character).eq(Expr::val(crate::ColumnType(vec![1.0, 2.0])))
     |                                                         ~~~~~~~~~~~~~~~~~
2121 |                 Expr::col(Char::Character).eq(Expr::val(sea_query::ColumnType(vec![1.0, 2.0])))
     |                                                         ~~~~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0433`.
error: could not compile `sea-query` (test "test-postgres") due to 1 previous error
@hamirmahal
Copy link
Contributor Author

I've tried running all of these commands beforehand.

cargo build --workspace --no-default-features
cargo build --workspace --all-features
cargo build --workspace --features=with-chrono
cargo build --workspace --features=with-json
cargo build --workspace --features=with-rust_decimal
cargo build --workspace --features=with-bigdecimal
cargo build --workspace --features=with-uuid
cargo build --workspace --features=with-time
cargo build --workspace --features=with-ipnetwork
cargo build --workspace --features=with-mac_address
cargo build --workspace --features=postgres-array
cargo build --workspace --features=postgres-vector
cargo build --workspace --features=thread-safe

cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array,postgres-vector
cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=with-chrono
cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=with-json
cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=with-rust_decimal
cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=with-bigdecimal
cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=with-uuid
cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=with-time
cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=with-ipnetwork
cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=with-mac_address
cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=postgres-array
cargo build --manifest-path sea-query-binder/Cargo.toml --workspace  --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-"${{ matrix.runtime }"}-"${{ matrix.tls }"} --features=postgres-vector

cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array,postgres-vector
cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=with-chrono
cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=with-json
cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=with-rust_decimal
cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=with-bigdecimal
cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=with-uuid
cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=with-time
cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=with-ipnetwork
cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=with-mac_address
cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=postgres-array
cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace  --features=postgres-vector

cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array,postgres-vector
cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=with-chrono
cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=with-json
cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=with-rust_decimal
cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=with-bigdecimal
cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=with-uuid
cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=with-time
cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=with-ipnetwork
cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=with-mac_address
cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=postgres-array
cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace  --features=postgres-vector

@billy1624 billy1624 self-assigned this Sep 6, 2024
@billy1624
Copy link
Member

Hey @hamirmahal, thanks for the report! The issue originated from a postgres-vector test case not place behind a feature guard. I also add cargo test to the CI to prevent this from happening again.

@hamirmahal
Copy link
Contributor Author

You're welcome, @billy1624! Thanks for fixing this.

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

2 participants