test(pr-safety): cover analyzer matching edge cases#900
Merged
Conversation
Co-authored-by: Mehmet Özel <madara88645@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
There was a problem hiding this comment.
PR Risk Assessment
Risk level: Very Low
Evidence (diff-based)
- Files changed: 1 (
tests/test_pr_safety.py) - Diff size: +33 / −0 lines
- Production code: none modified
- Infrastructure / auth / prompts: none touched
What changed
Adds two focused regression tests for the PR Safety analyzer:
test_nested_spec_test_file_clears_gap_for_component— verifies nested__tests__/Component.spec.tsxlayouts clear false "missing tests" gaps.test_scope_focus_term_can_match_a_later_file— verifies scope focus terms can match a later file in the changed-file list without false scope-mismatch holds.
Both tests call analyze_pr_safety(...) and assert on report fields only; no analyzer implementation was changed in this PR.
Decision
| Item | Result |
|---|---|
| Review required? | No |
| Reviewers assigned | None (not needed) |
| Recommended action | Approve (Very Low risk) |
Rationale: Test-only change with no behavioral or production surface impact. Matches Very Low criteria (test-only, small diff, no shared-system modification).
Notes
- No CODEOWNERS file found; no codeowner review gate.
- No prior reviews or approvals on this PR.
- Automated approval was not posted: GitHub blocks approving your own pull request.
- PR state at assessment time: merged.
Sent by Cursor Automation: Assign PR reviewers
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
Risky behavior now covered
__tests__/Component.spec.tsx, so it is less likely to falsely report “missing tests” on common React/Next test layoutsTest files added/updated
tests/test_pr_safety.pyWhy these tests materially reduce regression risk
Verification
python3 -m pytest tests/test_pr_safety.py tests/test_pr_safety_api.py tests/test_pr_safety_export.py -q26 passed in 0.16sNotes
requirements.txtbefore testing becauseorjsonwas missing in the VM.