-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathtest_connectors.rs
55 lines (45 loc) · 1.68 KB
/
test_connectors.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use std::sync::Arc;
use dozer_ingestion::test_util::create_test_runtime;
use test_suite::{
run_test_suite_basic_cud, run_test_suite_basic_data_ready, run_test_suite_basic_insert_only,
};
use tokio::runtime::Runtime;
#[cfg(feature = "datafusion")]
#[test]
fn test_local_storage() {
let runtime = create_test_runtime();
runtime.block_on(test_local_storage_impl(runtime.clone()));
}
#[cfg(feature = "datafusion")]
async fn test_local_storage_impl(runtime: Arc<Runtime>) {
let _ = env_logger::builder().is_test(true).try_init();
run_test_suite_basic_data_ready::<test_suite::LocalStorageObjectStoreConnectorTest>(
runtime.clone(),
)
.await;
run_test_suite_basic_insert_only::<test_suite::LocalStorageObjectStoreConnectorTest>(runtime)
.await;
}
#[test]
fn test_postgres() {
let runtime = create_test_runtime();
runtime.block_on(test_postgres_impl(runtime.clone()));
}
async fn test_postgres_impl(runtime: Arc<Runtime>) {
let _ = env_logger::builder().is_test(true).try_init();
run_test_suite_basic_data_ready::<test_suite::PostgresConnectorTest>(runtime.clone()).await;
run_test_suite_basic_insert_only::<test_suite::PostgresConnectorTest>(runtime.clone()).await;
run_test_suite_basic_cud::<test_suite::PostgresConnectorTest>(runtime).await;
}
#[cfg(feature = "mongodb")]
#[test]
fn test_mongodb() {
let runtime = create_test_runtime();
runtime.block_on(test_mongodb_impl(runtime.clone()));
}
#[cfg(feature = "mongodb")]
async fn test_mongodb_impl(runtime: Arc<Runtime>) {
let _ = env_logger::builder().is_test(true).try_init();
run_test_suite_basic_data_ready::<test_suite::MongodbConnectorTest>(runtime).await;
}
mod test_suite;