Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

test(verify): opt-in CAP_VERIFY_LOG subscriber for product and wgpu logs on remote runners

Richie McIlroy01d2334012a6
diff --git a/Cargo.lock b/Cargo.lock
index c4fa7253a..c398b37ac 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2174,6 +2174,7 @@ dependencies = [
"tempfile",
"tokio",
"toml 0.8.2",
+ "tracing-subscriber",
"workspace-hack",
]
diff --git a/crates/verify/Cargo.toml b/crates/verify/Cargo.toml
index b0da67135..206b03074 100644
--- a/crates/verify/Cargo.toml
+++ b/crates/verify/Cargo.toml
@@ -34,3 +34,4 @@ cap-editor = { path = "../editor" }
cap-export = { path = "../export" }
cap-rendering = { path = "../rendering" }
tempfile = "3"
+tracing-subscriber = { version = "0.3", features = ["env-filter"] }
diff --git a/crates/verify/tests/common/mod.rs b/crates/verify/tests/common/mod.rs
index 8023db473..67aa9d6a0 100644
--- a/crates/verify/tests/common/mod.rs
+++ b/crates/verify/tests/common/mod.rs
@@ -23,8 +23,19 @@ pub fn runtime() -> tokio::runtime::Runtime {
.expect("runtime")
}
+/// `CAP_VERIFY_LOG=<filter>` (EnvFilter syntax, e.g. `wgpu_hal=warn,cap_rendering=info`)
+/// prints product and wgpu logs to stderr, for triage on remote runners.
pub fn init() {
media::init();
+ static LOG: std::sync::Once = std::sync::Once::new();
+ LOG.call_once(|| {
+ if let Ok(filter) = std::env::var("CAP_VERIFY_LOG") {
+ let _ = tracing_subscriber::fmt()
+ .with_env_filter(tracing_subscriber::EnvFilter::new(filter))
+ .with_writer(std::io::stderr)
+ .try_init();
+ }
+ });
}
/// A ready fixture project plus its decoded source truth.