Commit 4fa4e11
committed
itest: Add output capture, metadata emission, proc macro, VM resource capping
Major feature expansion of the itest integration test framework to
make it reusable across bootc-dev projects (bcvk, composefs-rs, bootc).
Fork-exec output capture: when not under nextest or tmt, the harness
re-executes itself per test to capture stdout/stderr, preventing
interleaved output from parallel tests.
Test metadata: --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. Per-test TestMeta (timeout,
needs_root, isolation, tags, flaky, etc.) maps to format-specific
fields. Verified end-to-end with tmt.
Proc macro: #[itest::test_attr] attribute macro replaces the
declarative macros. Preserves doc comments, auto-converts error
types (anyhow/eyre compatible), detects async fn and wraps with a
tokio runtime, and accepts all metadata as attribute arguments.
VM resource capping: when no explicit --itype is set, itest detects
host memory (from /proc/meminfo and cgroup v2/v1 limits) and caps
the VM to 70% of available memory. Prevents OOM on constrained CI
runners like GHA (7 GiB / 2 vCPU). Override via ITEST_VM_MEMORY_MIB,
ITEST_VM_VCPUS, or ITEST_VM_MEMORY_FRACTION.
Spiked on composefs-rs: 43 tests migrated, net -120 lines deleted,
all tests pass.
Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>1 parent 4a4f5c6 commit 4fa4e11
File tree
12 files changed
+2432
-66
lines changed- crates
- itest-macros
- src
- itest
- src
- tests
12 files changed
+2432
-66
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