Skip to content

test(trigger): pin /test's case-insensitive name and path match, the OK-To-Test label already present, and the green non-PR arm of /test and /ok-to-test - #524

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-trigger-case-insensitive-match
Oct 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-trigger-case-insensitive-match

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Files: __tests__/issueCommentTest/trigger.test.ts only (/test, /ok-to-test describes). No src/, dist/, docs/ or config change — disjoint from the open held PRs #510 (src/utils/auth.ts, dist/index.js), #511 (docs/contributing.md), #512 (__tests__/label/remove.test.ts, eslint.config.mjs), #514 (__tests__/utils/{command,labelMatch}.test.ts), #516 (__tests__/cronJobTest/sweep.test.ts), #518 (__tests__/plugins/tide*.test.ts), #520 (__tests__/plugins/requireMatchingLabel.test.ts) and #522 (__tests__/plugins/approve*.test.ts).

A 117-mutant single-operator probe over src/issueComment/trigger.ts on main @ 88241f4 (details on #523) left five non-equivalent survivors against npx vitest related src/issueComment/trigger.ts --run (43 files / 837 tests). One case per survivor:

mutant new or extended test
trigger.ts:272 name compared without toLowerCase() /test › /test e2e matches the display name case-insensitively when the other does not match at all — display name E2E, file end-to-end.yml
trigger.ts:275 path compared without toLowerCase() /test › /test lint-checks matches the file basename case-insensitively… — file Lint-Checks.yml, name Lint
trigger.ts:121 existing label compared exactly /ok-to-test › recognises the label already present in another case: no re-add, the no-runs comment instead of a reaction (OK-To-Test)
trigger.ts:72 /test cmd === null /test › on an issue … and leaves the run green — adds the setFailed spy and the exact calls list, as the /retest sibling already asserts
trigger.ts:113 /ok-to-test cmd === null /ok-to-test › same — setFailed not called and the runs endpoint not read (this describe runs the post-command sweep, so the exact calls list is not asserted)

Verification (this branch, local)

  • npx vitest run __tests__/issueCommentTest/trigger.test.ts: 51 passed
  • same, with each mutant applied to src/issueComment/trigger.ts in turn: :72 1 failed, :113 1 failed, :121 1 failed, :272 1 failed, :275 1 failed (mutants reverted, not committed)
  • npx eslint __tests__/issueCommentTest/trigger.test.ts: clean

Related Issue

Fixes #523


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

…OK-To-Test label already present, and the green non-PR arm

Five single-operator mutants of src/issueComment/trigger.ts survived
`npx vitest related src/issueComment/trigger.ts --run` (43 files / 837
tests) on main @ 88241f4. One case per survivor:

- :272 `(run.name ?? '').toLowerCase() === arg` -> no toLowerCase:
  `/test e2e` matches the display name `E2E` whose file is
  end-to-end.yml, so the name comparison is the deciding arm.
- :275 `run.path.toLowerCase()` -> `run.path`: `/test lint-checks`
  matches .github/workflows/Lint-Checks.yml.
- :121 `label.toLowerCase() === okToTestLabel` -> exact compare: a pull
  request already carrying `OK-To-Test` is not re-labelled and, with
  nothing pending, gets the no-runs comment instead of a rocket.
- :72 and :113 `cmd === undefined` -> `cmd === null`: `/test` and
  `/ok-to-test` on a plain issue leave core.setFailed uncalled, as the
  /retest sibling test already asserts.

Fixes #523

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@github-actions

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind feature, /kind failing-test or /kind cleanup.

@mrbobbytables mrbobbytables left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.

Workflow-name and file-name casing are exercised independently. Existing mixed-case OK-To-Test is not re-added, and issue-only refusals assert no action failure or workflow listing.

Verified successful build-test, e2e-coverage and DCO results on head 74b8127. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.

@mrbobbytables mrbobbytables added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. needs-kind labels Oct 21, 2026
@mrbobbytables
mrbobbytables merged commit 38a8a85 into main Oct 21, 2026
16 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-trigger-case-insensitive-match branch October 26, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

1 participant