Skip to content

Commit

Permalink
Exclude tests {mongo, redis} using features (gluesql#1463)
Browse files Browse the repository at this point in the history
* build: separate test-redis as a feature
* fix: exclude all mongo cases
  • Loading branch information
devgony authored Mar 9, 2024
1 parent 01dc4bc commit cd80c03
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
cd pkg/rust
cargo test --lib --bins --tests --examples --verbose --no-default-features --features "memory-storage sled-storage"
cd ../../
run_storage_tests:
name: Run storage tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
redis-version: 6
- run: |
cd storages/redis-storage
cargo test --verbose
cargo test --verbose --features test-redis
run_examples:
name: Run examples
Expand Down
2 changes: 2 additions & 0 deletions storages/mongo-storage/tests/mongo_indexes.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "test-mongo")]

use {
bson::{doc, Document},
gluesql_core::prelude::{Glue, Payload},
Expand Down
3 changes: 2 additions & 1 deletion storages/mongo-storage/tests/mongo_storage.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "test-mongo")]

use {
async_trait::async_trait, gluesql_core::prelude::Glue, gluesql_mongo_storage::MongoStorage,
test_suite::*,
Expand Down Expand Up @@ -25,5 +27,4 @@ impl Tester<MongoStorage> for MongoTester {
}
}

#[cfg(feature = "test-mongo")]
generate_store_tests!(tokio::test, MongoTester);
2 changes: 2 additions & 0 deletions storages/mongo-storage/tests/mongo_types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "test-mongo")]

use {
bson::{doc, Bson},
gluesql_core::prelude::{Glue, Payload, Value},
Expand Down
3 changes: 3 additions & 0 deletions storages/redis-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ futures = "0.3"
test-suite.workspace = true
tokio = { version = "1", features = ["rt", "macros"] }
toml = "0.8.6"

[features]
test-redis = []
2 changes: 2 additions & 0 deletions storages/redis-storage/tests/redis_errors.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "test-redis")]

use {
gluesql_core::prelude::{Error, Payload},
gluesql_redis_storage::RedisStorage,
Expand Down
2 changes: 2 additions & 0 deletions storages/redis-storage/tests/redis_reconnect.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "test-redis")]

use {
gluesql_core::prelude::{Payload, Value},
gluesql_redis_storage::RedisStorage,
Expand Down
4 changes: 2 additions & 2 deletions storages/redis-storage/tests/redis_store.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "test-redis")]

use {
async_trait::async_trait,
gluesql_core::prelude::Glue,
Expand Down Expand Up @@ -51,9 +53,7 @@ impl Tester<RedisStorage> for RedisStorageTester {
}

generate_store_tests!(tokio::test, RedisStorageTester);

generate_alter_table_tests!(tokio::test, RedisStorageTester);

generate_metadata_table_tests!(tokio::test, RedisStorageTester);

macro_rules! exec {
Expand Down
2 changes: 2 additions & 0 deletions storages/redis-storage/tests/redis_table.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "test-redis")]

use {
gluesql_core::prelude::{Glue, Payload, Value},
gluesql_redis_storage::RedisStorage,
Expand Down

0 comments on commit cd80c03

Please sign in to comment.