Repository navigation
Commit 8baa8ea
authored
test: derive the command-surface enumerations that restated a declaration (#2713)
* test(coverage): recount the published summaries instead of pinning them
Each platform coverage manifest already derives its classification summary from its own rows, and
the smoke test that owns the manifest then compared that derived value to a hand-incremented
literal. Adding one public command therefore cost five files whose only edit was `54` becoming
`55`, while the invariant those files actually protect — every public command is classified, and
the published rollup is the manifest's own — was asserted nowhere.
`assertCoverageClassificationSummaryDerivedFromManifest` now recounts the manifest independently of
the builder, ties `total` to the public catalog's size, and checks the buckets still sum. Parity was
verified against the deleted literals before removal, as ADR 0008 requires: macOS 22/15/18/55, web
42/1/12/55, Linux 29/9/17/55, tvOS 17/38/0/55, Android 14/0/41/55, all equal to the derived rollup
at this head. The web lane's `liveCommands.length === 12` goes the same way: the loop beneath it
already proves each live claim is executed by the smoke scenario, so a count proved only that the
list was not empty.
A planted mis-bucketed summary and a planted denominator drift both fail, naming the platform.
* test(daemon): read the generic route from the descriptor that declares it
The test enumerated eleven commands to prove that the daemon's fallthrough route is reached on
purpose. Ten of those commands already declare the decision as `daemon.route: 'generic'`, which is
where `getDaemonCommandRoute` reads it from, so the list was a second source of truth that every new
generic command had to be added to.
The expected set is now that trait, projected. What remains hand-written is the case the list was
actually guarding — a catalog command that declares no daemon facet at all and lands on the
`?? 'generic'` fallback — and it is asserted alone, with a message that names the declaration to
add instead. Removing `viewport`'s facet locally fails with `['viewport', 'install-from-source']`
against that one expected member.
* test(runtime-facts): fill the fail-closed test facts from the owner's helper
`createUnavailableRuntimeFactsForTest` restated all twenty-seven fail-closed cells, plus the nine
lifecycle cells, to say what `createFullyUnavailablePlatformRuntimeFacts` already builds: every cell
unavailable for one reason. The two forms are equal because the input's `network` cell carries the
same sentinel the omitted optional cells would have inherited.
A new runtime cell therefore costs nothing here, which is the point of the fail-closed default:
a test that overrides a cell states its own exception, and one that does not inherits the refusal
without anyone remembering to write it down.
* test(coverage): name the summary guard for what it guards, and close the web live bucket
`buildCoverageClassificationSummary` and the recount in the assertion read the same manifest rows, so
a row classified under the wrong `level` moves both sides and stays consistent. The helper therefore
guards wiring and denominator, never per-row classification, and it now says so by name
(`assertCoverageClassificationSummaryWiredToManifest`) and in its doc comment, which also names where
row membership is actually gated: the Linux lane against its parsed replay script, the Android lane
against each scenario's own command declaration, the web lane against the commands its smoke scenario
invokes, and macOS one way only, since its provider scenarios invoke commands they deliberately do not
claim live.
The web lane gains that third gate, replacing both the old `liveCommands.length === 12` and the weaker
`> 0` this PR first introduced. It parses the smoke scenario's argv heads and compares them to the
manifest's live set in both directions, so a command the scenario runs without a live claim, or a live
claim the scenario stopped honouring, fails by name. The parsed set equals the claimed set exactly
today, so the count the pin carried survives without being hand-incremented. Appending a line
containing `['hover',` to the scenario makes the gate fail on `hover`.
`localCliCommands()` is dropped from the daemon route test: `CATALOG_COMMANDS` is the public and
internal groups, and a `catalog.group: 'local-cli'` descriptor is never projected into either, so the
clause could not fire. The reasoning is left where the clause was.
* test(coverage): close the macOS live bucket from its scenario sources too
The commit before this one recorded macOS as gated one way only, on the finding that its provider
scenarios execute `open`, `appstate`, `snapshot`, `screenshot`, `wait` and `click` without claiming
them live. That reading was wrong: those commands are claimed live, attributed to the replay scenario,
so the mismatch is scenario attribution and not a missing claim. Compared at platform level, the
commands the live scenarios execute and the commands the manifest calls live are the same 18.
`assertLiveCoverageMatchesEvidence` states that tie for the two platforms whose evidence enumerates its
own commands — macOS through `parseReplayScriptDetailed` and the provider call shapes, web through the
argv heads its smoke scenario passes — and Linux and Android already read the same kind of enumeration
directly. Appending `callCommand('hover', …)` to a macOS live scenario fails the gate with the platform
named, and the rollup assertion's doc comment now points here for membership instead of implying it
covers classification.1 parent ec30f3c commit 8baa8ea
8 files changed
Lines changed: 234 additions & 116 deletions
File tree
- src
- __tests__/test-utils
- daemon/__tests__
- test/integration
- support
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
146 | 115 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
55 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
56 | 86 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 87 | + | |
| 88 | + | |
68 | 89 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
75 | 93 | | |
76 | 94 | | |
77 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | | - | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
59 | 55 | | |
60 | 56 | | |
61 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
| 23 | + | |
| 24 | + | |
17 | 25 | | |
18 | | - | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
| |||
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
52 | 64 | | |
53 | 65 | | |
54 | 66 | | |
| |||
123 | 135 | | |
124 | 136 | | |
125 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
126 | 172 | | |
127 | 173 | | |
128 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
0 commit comments