Rust Tests
Set up test analytics for Rust projects and capture per-test durations with cargo test.
Everr parses Rust libtest output to track individual test results, detect flaky tests, and analyze failures.
Setup
Run your Rust tests with the nightly toolchain and --report-time so libtest emits per-test durations:
cargo +nightly test -- --report-time -Z unstable-optionsGitHub Actions workflow example
- name: Run tests
run: cargo +nightly test -- --report-time -Z unstable-optionsEverr automatically detects and parses Rust test output from workflow logs. Plain cargo test still produces pass/fail/ignored spans, but --report-time is required if you want non-zero everr.test.duration_seconds.
What gets parsed
The parser recognizes the Rust libtest output patterns:
| Pattern | Meaning |
|---|---|
Running unittests src/lib.rs (target/debug/deps/my_crate-...) | Starts a new Rust test target |
test my_module::tests::works ... ok <0.055s> | Test passed with duration |
test my_module::tests::fails ... FAILED <0.250s> | Test failed with duration |
test my_module::tests::ignored_case ... ignored <0.000s> | Test skipped/ignored |
Doc-tests my_crate | Starts doctest output for a crate |
Module hierarchy
Rust test names use the :: separator to represent module nesting. For example:
test parser::tests::parses_config ... ok <0.055s>This is parsed as:
- Package:
my_crateor the current cargo test target - Module path:
parser::tests - Test name:
parses_config
Everr synthesizes module nodes from the :: hierarchy, so modules can be browsed like suites. Module nodes get everr.test.is_suite=true, nested entries get everr.test.is_subtest=true, and everr.test.parent_test points to the parent module path.
Generated span attributes
| Attribute | Value |
|---|---|
everr.test.name | Full test name (e.g. parser::tests::parses_config) |
everr.test.result | pass, fail, or skip |
everr.test.duration_seconds | Duration from --report-time output |
everr.test.framework | rust |
everr.test.package | Cargo test target or doctest crate name |
everr.test.is_suite | true for synthesized module nodes that contain child tests |
everr.test.is_subtest | true for nested module nodes and tests |
everr.test.parent_test | Parent module path |