tesults-test
A Rust integration for Tesults that replaces #[test] with #[tesults_test::test] to add enhanced test reporting — timing, descriptions, steps, custom fields, and file attachments — with no changes to how you run tests.
Installation
Add to [dev-dependencies] in Cargo.toml:
[]
= "1"
Usage
Replace #[test] with #[tesults_test::test]:
Set TESULTS_TARGET and run tests as usual:
TESULTS_TARGET=token
Results are uploaded to Tesults once after all tests complete. If TESULTS_TARGET is not set, nothing is uploaded.
Enhanced reporting
Call these helpers inside a test body to enrich the result:
| Helper | Purpose |
|---|---|
tesults_test::description(text) |
Free-text description shown in Tesults |
tesults_test::custom(key, value) |
Custom key-value field |
tesults_test::step(name, result, desc, reason) |
Named step with pass/fail |
tesults_test::file(path) |
File path to upload (screenshot, log, etc.) |
#[should_panic]
Works as normal — #[should_panic] stays on the function and #[tesults_test::test] records the correct pass/fail:
Config file (optional)
Keep tokens out of scripts with a key name and a config file:
TESULTS_TARGET=my-target TESULTS_CONFIG=/path/to/tesults.cfg
tesults.cfg format:
# Tesults target tokens
my-target = eyJ0eXAiOiJ...
staging = eyJ0eXAiOiK...
Suite names
The suite for each test is derived from its Rust module path. A test in my_crate::tests is reported under suite tests. Tests in integration test files (tests/my_test.rs) use the file stem as the suite name.