Skip to content

test(discovery): add the adr-e2e command line - #72

Closed
pengyuzhang wants to merge 1 commit into
pr/15-runnerfrom
pr/16-cli
Closed

test(discovery): add the adr-e2e command line#72
pengyuzhang wants to merge 1 commit into
pr/15-runnerfrom
pr/16-cli

Conversation

@pengyuzhang

Copy link
Copy Markdown
Collaborator

Stacked on #71. Last of the series.

Four subcommands over the pieces already in place.

python3 -m tests.manifest_check             # static checks - no VM, what CI runs
python3 -m tests.cli score DIR --report     # re-score a run directory
python3 -m tests.cli report DIR             # scorecard from an existing score.json
python3 -m tests.cli run --os linux --out DIR --driver lima
python3 -m tests.cli run --os mac --out DIR --driver tart --image adr-macos --user admin

score and report never touch a VM

The property that matters day to day. A scoring change is replayed over every recorded run in milliseconds, and somebody debugging a false positive needs nothing but the run directory:

$ time python3 -m tests.cli score tests/recorded/synthetic-linux
score    tp=73 fp=2 fn=2 dup=5 recall=0.9733 precision=0.9733
canaries 6 planted, 0 leaked
gate     FAILED: duplicates
0.03s

Exit code is 2 when the gate fails, so it can gate a release.

check delegates rather than duplicates

The static checks are already a module because CI runs them directly (#59) and does not need the rest of this file. Two copies of the same rules would eventually disagree, and the copy CI runs is the one that matters.

A failed scan is a failed run

Not an empty inventory. A host that reported nothing and a host that never reported are different facts, and conflating them would score every entry a miss.

--driver dry

Runs the installer against a guest that records commands instead of executing them. It exercises ordering, canary substitution and the recorded outcomes with no hypervisor — and it has no collector in it, so the score it produces is meaningless by construction and says so.

HARNESS.md

Also updated with what is actually validated:

guest applicable installed failed
Linux Ubuntu 24.04.4 aarch64 (lima) 105 52 0
macOS 15.7.7 arm64 (tart) 110 50 1
Windows 103 not validated

Verification

$ python3 -m unittest discover -s tests -t . -q
Ran 110 tests in 0.074s
OK

Four subcommands over the pieces already here: check, run, score, report.

score and report never touch a VM, which is the property that matters day to
day. A scoring change is replayed over every recorded run in milliseconds, and
somebody debugging a false positive needs nothing but the run directory.

check delegates to the manifest_check module rather than repeating it. CI runs
that module directly and does not need the rest of this file; two copies of the
same rules would eventually disagree, and the copy CI runs is the one that
matters.

A guest that cannot scan is recorded as a failed run rather than as an empty
inventory. A host that reported nothing and a host that never reported are
different facts, and conflating them would score every entry a miss.
@pengyuzhang
pengyuzhang deleted the pr/16-cli branch August 23, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants