Commit 3747d69
committed
test(integ): harden the aws-command extractor against review findings
Review of the first pass found three real defects, all verified against the
current tree.
FALSE POSITIVES (the worst of the three). Only `#` comments were stripped, so
prose and data parsed as invocations:
echo "==> Verifying deploy via aws cli (sanity)" -> aws cli sanity
arn:aws:s3:::my-bucket -> aws s3 my-bucket
Tags[?Key==`aws:cdk:path`] -> aws cdk path
Harmless only because those verbs are not in the removal table — a fixture's
own `echo "... aws emr list-instance-groups ..."` explanation would have become
a CI-blocking violation curable only by DELETING the explanation, the exact
outcome comment-stripping exists to prevent. They also inflated the coverage
floors with non-invocations (2687 -> 2640 real; services 70 -> 68, verbs
362 -> 355).
Fixed by blanking quoted spans while PRESERVING $( ) command substitutions —
both halves load-bearing, since the capture form lives inside double quotes and
is the largest shape in the tree (1028 invocations, unchanged by the fix) — and
by keeping `:` inside tokens so an ARN or a JMESPath backtick literal stays one
token instead of splitting out a bare `aws`.
FALSE NEGATIVE: `aws --region us-east-1 emr list-instance-groups` vanished
SILENTLY — the service slot held `--region`, NAME rejected it, and the call went
unchecked with no diagnostic. Now steps past leading global options, consuming
the value of the value-taking ones.
ESCAPE-HATCH LEAKS: the marker was matched on raw line text, so it counted
inside a string literal, and "the line above" accepted a marker trailing the
PREVIOUS command. Now read only from the stripped comment, and the line-above
form requires a whole-line comment.
Also in refresh-aws-cli-removals.ts: `command -v aws` THROWS when absent so the
actionable not-found message was unreachable; `--check` threw on a corrupt
fixture instead of reporting stale; `--aws-root` with no value silently fell
back to PATH (or took `--check` as the path); and the parser now reconciles
against an independent count of building-command-table events, so a reordered
remove() call fails loudly instead of dropping a service silently.
Real-code fail probe re-run through the hardened parser: injecting BOTH the
capture form and the leading-global-option form into the real
emr-cluster/verify.sh flagged both, each named by file:line; restored after.1 parent 67cbe52 commit 3747d69
3 files changed
Lines changed: 230 additions & 21 deletions
File tree
- scripts
- tests/unit/scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 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 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 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 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
90 | 179 | | |
91 | 180 | | |
92 | 181 | | |
| |||
109 | 198 | | |
110 | 199 | | |
111 | 200 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
117 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
118 | 213 | | |
119 | | - | |
| 214 | + | |
120 | 215 | | |
121 | 216 | | |
122 | 217 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
129 | 245 | | |
130 | 246 | | |
131 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
| |||
116 | 124 | | |
117 | 125 | | |
118 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
119 | 135 | | |
120 | 136 | | |
121 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
122 | 145 | | |
123 | 146 | | |
124 | 147 | | |
| |||
143 | 166 | | |
144 | 167 | | |
145 | 168 | | |
146 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
147 | 177 | | |
148 | 178 | | |
149 | 179 | | |
150 | 180 | | |
151 | 181 | | |
152 | 182 | | |
153 | 183 | | |
154 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
155 | 193 | | |
156 | | - | |
157 | | - | |
158 | | - | |
| 194 | + | |
| 195 | + | |
159 | 196 | | |
160 | 197 | | |
161 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
170 | 210 | | |
171 | 211 | | |
172 | 212 | | |
| |||
177 | 217 | | |
178 | 218 | | |
179 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
180 | 236 | | |
181 | 237 | | |
182 | 238 | | |
| |||
232 | 288 | | |
233 | 289 | | |
234 | 290 | | |
235 | | - | |
| 291 | + | |
236 | 292 | | |
237 | 293 | | |
238 | 294 | | |
| |||
249 | 305 | | |
250 | 306 | | |
251 | 307 | | |
252 | | - | |
| 308 | + | |
253 | 309 | | |
254 | 310 | | |
255 | 311 | | |
| |||
0 commit comments