Skip to content

test(pr-safety): cover analyzer matching edge cases#900

Merged
madara88645 merged 1 commit into
mainfrom
cursor/missing-test-coverage-29f7
Jul 1, 2026
Merged

test(pr-safety): cover analyzer matching edge cases#900
madara88645 merged 1 commit into
mainfrom
cursor/missing-test-coverage-29f7

Conversation

@cursor

@cursor cursor Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add focused regression coverage for PR Safety analyzer matching logic
  • keep this as a test-only change; no production behavior changes

Risky behavior now covered

  • PR Safety now has locked coverage for nested frontend test naming like __tests__/Component.spec.tsx, so it is less likely to falsely report “missing tests” on common React/Next test layouts
  • scope matching now has locked coverage for focus terms that only match a later file in the changed-file list, reducing the chance of false "scope mismatch" holds

Test files added/updated

  • tests/test_pr_safety.py

Why these tests materially reduce regression risk

  • this logic sits in the shared PR Safety analyzer, which influences merge/hold recommendations
  • false gaps or false scope mismatches create noisy warnings and can block safe PRs, so locking these edge cases down helps keep the tool trustworthy

Verification

  • python3 -m pytest tests/test_pr_safety.py tests/test_pr_safety_api.py tests/test_pr_safety_export.py -q
  • result: 26 passed in 0.16s

Notes

  • I also had to sync the local Python environment with requirements.txt before testing because orjson was missing in the VM.
  • Aikido MCP tooling was not available in this environment, so I could not run the requested automated security scan.
Open in Web View Automation 

Co-authored-by: Mehmet Özel <madara88645@users.noreply.github.com>
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
compiler Ready Ready Preview, Comment Jun 30, 2026 10:04am

@madara88645 madara88645 marked this pull request as ready for review July 1, 2026 05:38
@madara88645 madara88645 merged commit ace43a4 into main Jul 1, 2026
12 checks passed
@madara88645 madara88645 deleted the cursor/missing-test-coverage-29f7 branch July 1, 2026 05:38

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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:

  1. test_nested_spec_test_file_clears_gap_for_component — verifies nested __tests__/Component.spec.tsx layouts clear false "missing tests" gaps.
  2. 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.
Open in Web View Automation 

Sent by Cursor Automation: Assign PR reviewers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants