diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edba378..5fafa11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,7 @@ jobs: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - uses: taiki-e/install-action@cargo-make + - uses: taiki-e/install-action@nextest - run: cargo make test alls-green: diff --git a/Makefile.toml b/Makefile.toml index 62eb9a1..e19e80a 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -15,9 +15,10 @@ command = "cargo" args = ["fmt", "--", "--check"] [tasks.test] +install_crate = "cargo-nextest" description = "Run tests." command = "cargo" -args = ["test", "--all-features", "${@}"] +args = ["nextest", "run", "--all-features", "${@}"] [tasks.clippy] command = "cargo" diff --git a/tests/e2e/mod.rs b/tests/e2e/mod.rs index 8959095..31059e0 100644 --- a/tests/e2e/mod.rs +++ b/tests/e2e/mod.rs @@ -1,16 +1,12 @@ use opentelemetry_jaeger::testing::jaeger_api_v2::Span; use opentelemetry_jaeger::testing::jaeger_client::JaegerTestClient; use prima_tracing::{builder, configure_subscriber, init_subscriber, Country, Environment}; -use std::time::SystemTime; async fn get_spans(f: impl FnOnce()) -> Option> { std::env::set_var("RUST_LOG", "info"); // Unique id for this test run - let seed = SystemTime::now() - .duration_since(SystemTime::UNIX_EPOCH) - .unwrap() - .as_millis(); + let seed = std::fs::read_to_string("/proc/sys/kernel/random/uuid").unwrap(); let service_name = format!("e2e-test-{seed}"); let collector_url = "http://jaeger:55681"; @@ -41,7 +37,7 @@ async fn get_spans(f: impl FnOnce()) -> Option> { #[cfg(feature = "traces")] #[tokio::test(flavor = "multi_thread")] -async fn it_sends_traces_to_jaeger() { +async fn traces_are_sent_to_datadog() { let log_message = "hello it_sends_traces_to_jaeger"; let spans = get_spans(|| {