Skip to content

Commit ac717c1

Browse files
committed
chore(smoke-tests): Log tracing span events in smoke tests
See <cucumber-rs/cucumber#356>.
1 parent 7dc72d6 commit ac717c1

File tree

3 files changed

+55
-42
lines changed

3 files changed

+55
-42
lines changed

Cargo.lock

Lines changed: 40 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ axum-extra = { version = "0.10", default-features = false }
1818
axum-test = { version = "17", default-features = false }
1919
base64 = { version = "0.22", default-features = false }
2020
chrono = { version = "0.4", default-features = false }
21-
cucumber = { version = "0.21", default-features = false }
21+
cucumber = { branch = "353-fmt-layer-tweaking", git = "https://github.com/cucumber-rs/cucumber", default-features = false }
2222
email_address = { version = "0.2", default-features = false }
2323
figment = { version = "0.10", default-features = false }
2424
form_urlencoded = { version = "1", default-features = false }

crates/rest-api/tests/behavior.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ mod prelude;
1010
use cucumber::World as _;
1111
use tracing_subscriber::{
1212
filter::{self, LevelFilter},
13-
fmt::format::{self, Format},
13+
fmt::{
14+
self,
15+
format::{DefaultFields, FmtSpan, Format},
16+
},
1417
layer::{Layer, SubscriberExt as _},
1518
};
1619

@@ -21,17 +24,22 @@ async fn main() {
2124
TestWorld::cucumber()
2225
// .init_tracing()
2326
.configure_and_init_tracing(
24-
format::DefaultFields::new(),
25-
Format::default()
26-
.without_time()
27-
.with_ansi(true)
28-
.with_source_location(false),
27+
fmt::layer()
28+
.fmt_fields(DefaultFields::new())
29+
.event_format(
30+
Format::default()
31+
.without_time()
32+
.with_ansi(true)
33+
.with_source_location(false),
34+
)
35+
.with_span_events(FmtSpan::NEW | FmtSpan::CLOSE),
2936
|fmt_layer| {
3037
let targets = vec![
3138
("sea_orm_migration", LevelFilter::WARN),
3239
("sea_orm", LevelFilter::INFO),
3340
("sqlx::query", LevelFilter::ERROR),
3441
("globset", LevelFilter::WARN),
42+
("cucumber::tracing", LevelFilter::OFF),
3543
];
3644

3745
let args = std::env::args().collect::<Vec<_>>();

0 commit comments

Comments
 (0)