Commit d293722
committed
itest: New macro, support for tmt and debian autopkgtest, and more
A lot of stuff for itest, which is our Rust-based test framework
for integration testing.
Fork-exec output capture: when not running under nextest or tmt, the
harness re-executes itself per test to capture stdout/stderr, matching
cargo test default behavior. ITEST_NOCAPTURE=1 disables for debugging.
Test metadata generation: --emit-tmt and --emit-autopkgtest flags
generate FMF and DEP-8 metadata from registered tests, enabling tmt
and autopkgtest to discover and run individual tests. Verified
end-to-end with tmt.
TestMeta: per-test metadata struct (timeout, needs_root, isolation,
tags, summary, needs_internet, flaky) that maps to tmt and autopkgtest
fields. Stored in distributed slices alongside test functions.
Proc macro (#[itest::test_attr]): attribute macro that replaces the
declarative macros for cleaner ergonomics. Preserves doc comments,
handles error type conversion (anyhow/eyre/io::Error), supports async
fn via automatic tokio runtime creation, and accepts all metadata as
attribute arguments.
VM instance type: privileged_test! and booted_test! accept itype for
VM sizing, threaded through require_root() to bcvk --itype.
The Justfile now prefers nextest with cargo test fallback, and fixes a
pre-existing bug where set -e skipped cleanup on test failure.
Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>1 parent f4dd05a commit d293722
File tree
11 files changed
+1816
-57
lines changed- crates
- itest-macros
- src
- itest
- src
- tests
11 files changed
+1816
-57
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | | - | |
42 | | - | |
| 43 | + | |
43 | 44 | | |
44 | | - | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments