Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
akiradeveloper committed May 24, 2024
1 parent 525389d commit 0a7bf91
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 22 deletions.
7 changes: 3 additions & 4 deletions tests/env/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
use anyhow::Result;
use serial_test::serial;
use test_log::test;

#[serial]
#[test(tokio::test)]
#[tokio::test]
async fn connect_docker_daemon() -> Result<()> {
let _e = env::Env::new()?;
Ok(())
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn create() -> Result<()> {
let mut env = env::Env::new()?;
env.create(0, 1).await?;
Ok(())
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn start_stop() -> Result<()> {
let mut env = env::Env::new()?;
env.create(0, 1).await?;
Expand Down
5 changes: 2 additions & 3 deletions tests/lol-tests/tests/n10_tests.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use anyhow::Result;
use lol_tests::*;
use serial_test::serial;
use test_log::test;

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n10_cluster() -> Result<()> {
let mut cluster = Cluster::new(10, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand All @@ -15,7 +14,7 @@ async fn n10_cluster() -> Result<()> {
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n10_write() -> Result<()> {
let mut cluster = Cluster::new(10, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand Down
11 changes: 5 additions & 6 deletions tests/lol-tests/tests/n1_tests.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use anyhow::Result;
use lol_tests::*;
use serial_test::serial;
use test_log::test;

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n1_cluster() -> Result<()> {
let mut cluster = Cluster::new(1, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand All @@ -13,7 +12,7 @@ async fn n1_cluster() -> Result<()> {
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n1_write() -> Result<()> {
let mut cluster = Cluster::new(1, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand All @@ -27,7 +26,7 @@ async fn n1_write() -> Result<()> {
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n1_read() -> Result<()> {
let mut cluster = Cluster::new(1, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand All @@ -43,7 +42,7 @@ async fn n1_read() -> Result<()> {
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n1_snapshot() -> Result<()> {
let mut cluster = Cluster::new(1, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand All @@ -62,7 +61,7 @@ async fn n1_snapshot() -> Result<()> {
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n1_exec_once() -> Result<()> {
let mut cluster = Cluster::new(1, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand Down
13 changes: 6 additions & 7 deletions tests/lol-tests/tests/n3_tests.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use anyhow::Result;
use lol_tests::*;
use serial_test::serial;
use test_log::test;

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n3_cluster() -> Result<()> {
let mut cluster = Cluster::new(3, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand All @@ -14,7 +13,7 @@ async fn n3_cluster() -> Result<()> {
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n3_write() -> Result<()> {
let mut cluster = Cluster::new(3, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand All @@ -30,7 +29,7 @@ async fn n3_write() -> Result<()> {
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n3_snapshot() -> Result<()> {
let mut cluster = Cluster::new(3, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand All @@ -50,7 +49,7 @@ async fn n3_snapshot() -> Result<()> {
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n3_leader_stop() -> Result<()> {
let mut cluster = Cluster::new(3, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand All @@ -73,7 +72,7 @@ async fn n3_leader_stop() -> Result<()> {
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n3_leader_stepdown() -> Result<()> {
let mut cluster = Cluster::new(3, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand All @@ -97,7 +96,7 @@ async fn n3_leader_stepdown() -> Result<()> {
}

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn n3_down2_err() -> Result<()> {
let mut cluster = Cluster::new(3, 1).await?;
cluster.add_server(0, 0, 0).await?;
Expand Down
3 changes: 1 addition & 2 deletions tests/lol-tests/tests/reflection_tests.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use anyhow::Result;
use lol_tests::*;
use serial_test::serial;
use test_log::test;

#[serial]
#[test(tokio::test(flavor = "multi_thread"))]
#[tokio::test(flavor = "multi_thread")]
async fn reflection_grpcurl_access() -> Result<()> {
let _cluster = Cluster::new(1, 1).await?;

Expand Down

0 comments on commit 0a7bf91

Please sign in to comment.