Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MaeIsBad committed Mar 1, 2024
1 parent d0a4df4 commit bb378bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 2 additions & 6 deletions tests/e2e/mod.rs
Original file line number Diff line number Diff line change
@@ -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<Vec<Span>> {
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";
Expand Down Expand Up @@ -41,7 +37,7 @@ async fn get_spans(f: impl FnOnce()) -> Option<Vec<Span>> {

#[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(|| {
Expand Down

0 comments on commit bb378bc

Please sign in to comment.