Skip to content

Commit 790529e

Browse files
committed
test(integ): scope the prose fence to the full aws emr invocation
The #1402 prose fence collects every fixture whose verify.sh mentions `list-instance-groups` and asserts (a) it is not flagged and (b) uncommenting the mention DOES flag. The new emr-instance-fleets fixture names the verb in prose without the command prefix — # `list-instance-groups` sibling that is unusable, because that verb is ... — so uncommenting it yields no invocation and the positive control could not fire, failing with "fence is vacuous". Matching `aws emr list-instance-groups` keeps the fence about the case it exists for: a comment that spells out the banned COMMAND. A bare mention of the verb NAME is not that case. Only visible on the merge commit: #1415 (the fence) and this branch (the fixture) are individually green, and CI tests the PR merged into main.
1 parent 302caad commit 790529e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tests/unit/scripts/integ-aws-commands.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,16 @@ describe('integ fixture aws invocations (#1402)', () => {
456456
it('does not flag the fixtures that DISCUSS the removed command in comments', () => {
457457
const discussing = readdirSync(INTEG_ROOT, { withFileTypes: true })
458458
.filter((e) => e.isDirectory() && existsSync(join(INTEG_ROOT, e.name, 'verify.sh')))
459+
// Must be the FULL invocation, not a bare mention of the verb name. The
460+
// `emr-instance-fleets` fixture names `` `list-instance-groups` `` in prose
461+
// ("...it is only its `list-instance-groups` sibling that is unusable")
462+
// with no `aws emr` prefix, so uncommenting that line yields no
463+
// invocation and the positive control below cannot fire. Matching the
464+
// whole invocation keeps this fence about the case it exists for: a
465+
// comment that spells out the banned COMMAND.
459466
.filter((e) =>
460467
readFileSync(join(INTEG_ROOT, e.name, 'verify.sh'), 'utf8').includes(
461-
'list-instance-groups'
468+
'aws emr list-instance-groups'
462469
)
463470
)
464471
.map((e) => e.name);
@@ -479,7 +486,7 @@ describe('integ fixture aws invocations (#1402)', () => {
479486
const uncommented = content
480487
.split('\n')
481488
.map((l) =>
482-
l.trimStart().startsWith('#') && l.includes('list-instance-groups')
489+
l.trimStart().startsWith('#') && l.includes('aws emr list-instance-groups')
483490
? l.replace(/^(\s*)#\s?/, '$1')
484491
: l
485492
)

0 commit comments

Comments
 (0)