Commit d54ae6a
test(compat): add STUBCLI_NEEDS_TOKEN stub hook + token-style SkipDataPath self-test
The merged `Runner.SkipDataPath` self-test
(`TestRunContract_SkipDataPath_GatesDataSubtests`) is adversarial in
the broadest possible way: `STUBCLI_FORMATS=__never__` makes the stub
reject every `--format` value at parse time. That proves the
`SkipDataPath` guard is load-bearing, but against a failure mode
(parse-rejection) that no real exporter actually exhibits.
`STUBCLI_NEEDS_TOKEN=1` adds the tighter adversarial model called out
in DT's review of #14: parse succeeds, the data call fails non-zero
with `error: not logged in` on stderr. That is the shape real
credentialed exporters (crono / liftoff / withings) hit in CI when no
secrets are provisioned — the exact scenario `SkipDataPath` exists to
escape.
The new self-test (`TestRunContract_SkipDataPath_WithNotLoggedIn`)
runs the full formats bundle with `STUBCLI_NEEDS_TOKEN=1` and
`SkipDataPath: true`. Parse-level subtests pass because they assert
on the rejection side of unknown flags, which never reach the token
check. Data-path subtests skip via the guard.
Neutering the `SkipDataPath` guards in jsonIsArray / csvHasHeader /
defaultIsMarkdown makes the test fail with
`--format <codec> exited 1; stderr="error: not logged in\n"` — a
distinct failure shape from the `__never__` variant's
`invalid value for --format`. The two adversarial models therefore
cover different regressions of the same guard.
No contract or `Runner` surface changes. SkipDataPath shipped in #14
and is settled.
Refs:
- Closed PR #15 — origin of STUBCLI_NEEDS_TOKEN
- Merged PR #14 — Runner.SkipDataPath
- QUA-34
Co-Authored-By: Paperclip <[email protected]>1 parent 1cf4a39 commit d54ae6a
2 files changed
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
97 | 127 | | |
98 | 128 | | |
99 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
42 | 55 | | |
43 | 56 | | |
44 | 57 | | |
| |||
160 | 173 | | |
161 | 174 | | |
162 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
163 | 189 | | |
164 | 190 | | |
165 | 191 | | |
| |||
0 commit comments