Skip to content

test: TestFailurePromptTransformer 100% coverage#60

Open
jordanpartridge wants to merge 1 commit intomasterfrom
test/test-failure-prompt-transformer-coverage
Open

test: TestFailurePromptTransformer 100% coverage#60
jordanpartridge wants to merge 1 commit intomasterfrom
test/test-failure-prompt-transformer-coverage

Conversation

@jordanpartridge
Copy link
Contributor

Summary

  • Adds 61 comprehensive tests for TestFailurePromptTransformer covering all code paths
  • Tests organized in describe/it blocks per project conventions
  • Covers: canHandle(), JUnit XML parsing, Pest output parsing, all 21 assertion fix directions, 5 fallback fix patterns, ANSI stripping, message truncation, prompt formatting, and context parameter handling

Test plan

  • All 61 new tests pass
  • Full suite (264 tests) passes with no regressions
  • Pint formatting applied
  • Uses describe/it blocks (no test() functions)

Closes #45

61 tests covering all public methods and code paths:
- canHandle: test/pest/phpunit detection and rejection
- JUnit XML parsing: failures, errors, nested suites, missing attrs, invalid XML fallback
- Pest output parsing: cross/X marks, file/line extraction, pass/fail/unparseable
- Fix directions: all 21 assertion patterns + 5 fallback patterns
- Message cleaning: ANSI stripping, truncation
- Prompt formatting: numbering, headers, Unknown file handling

Closes #45
@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Warning

Rate limit exceeded

@jordanpartridge has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 60cd5481-a940-42e0-bca0-0ad3d3c68231

📥 Commits

Reviewing files that changed from the base of the PR and between 5691a60 and d8229cb.

📒 Files selected for processing (1)
  • tests/Unit/Transformers/TestFailurePromptTransformerTest.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/test-failure-prompt-transformer-coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

📊 Coverage Report

Metric Coverage Threshold Status
Lines 77.6% 100%

Files Below Threshold

File Coverage Uncovered Lines
app/Commands/AnalyzeCommand.php 0% 22, 23, 25, 26, 28... (+51 more)
app/Commands/CheckCommand.php 0% 30, 31, 33, 34, 37... (+91 more)
app/Transformers/PhpStanPromptTransformer.php 3.6% 49, 51, 52, 53, 54... (+76 more)
app/Services/PromptAssembler.php 88.9% 55, 56, 57, 58, 120
app/GitHub/ChecksClient.php 89.1% 218, 219, 222, 223, 226... (+8 more)

🏆 Synapse Sentinel Gate

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

🔧 Synapse Sentinel: 2 checks need attention

The following issues must be resolved before this PR can be merged:


All tests passed.---

Security Audit


Review the output and fix any issues.

Quick Reference:

  • PHPStan errors → Fix type mismatches first, then missing types
  • Test failures → Read the assertion message, trace expected vs actual
  • Style issues → Run composer format to auto-fix

🤖 Generated by Synapse Sentinel - View Run

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.

Write TestFailurePromptTransformer tests (coverage: 11.7% → 100%)

1 participant