fix(test): prevent detect-agent property test flake#899
Merged
Conversation
…m agentNameArb The agentNameArb arbitrary could generate strings like 'no', 'on', 'off', 'yes' that match TRUTHY_GARBAGE_RE or FALSY_GARBAGE_RE. When these appeared in compound tests, normalizeAgent short-circuits without extracting version or role, causing unconditional version/role assertions to fail.
Contributor
Codecov Results 📊✅ 6461 passed | Total: 6461 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 13257 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 75.97% 75.95% -0.02%
==========================================
Files 295 295 —
Lines 55045 55120 +75
Branches 0 0 —
==========================================
+ Hits 41819 41863 +44
- Misses 13226 13257 +31
- Partials 0 0 —Generated by Codecov Action |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
no,on,off,yes,true,false,0,1) fromagentNameArbindetect-agent.property.test.tsProblem
Follow-up to #896. The
agentNameArbarbitrary could randomly generate short strings like"no"or"on"that matchFALSY_GARBAGE_RE/TRUTHY_GARBAGE_RE. When these appeared in compound property tests (e.g."no/1.2.3/agent"),normalizeAgentwould short-circuit without extracting version/role, causing the unconditionalexpect(result!.version).toBe(version)assertion to fail.Caught by Cursor BugBot.