Add test-coverage workflow helper script and progress tracker#18
Add test-coverage workflow helper script and progress tracker#18
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: OctavianTocan <55554752+OctavianTocan@users.noreply.github.com>
Co-authored-by: OctavianTocan <55554752+OctavianTocan@users.noreply.github.com>
|
@copilot This PR doesn't follow the way the project structures Ralph features. You have just added scripts at random. |
Co-authored-by: OctavianTocan <55554752+OctavianTocan@users.noreply.github.com>
Co-authored-by: OctavianTocan <55554752+OctavianTocan@users.noreply.github.com>
Co-authored-by: OctavianTocan <55554752+OctavianTocan@users.noreply.github.com>
Co-authored-by: OctavianTocan <55554752+OctavianTocan@users.noreply.github.com>
Co-authored-by: OctavianTocan <55554752+OctavianTocan@users.noreply.github.com>
Co-authored-by: OctavianTocan <55554752+OctavianTocan@users.noreply.github.com>
Co-authored-by: OctavianTocan <55554752+OctavianTocan@users.noreply.github.com>
Co-authored-by: OctavianTocan <55554752+OctavianTocan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds infrastructure for a test-coverage workflow that uses Claude in a Docker sandbox to iteratively improve test coverage. The implementation provides a helper script that runs coverage improvements in a loop and a progress tracking file for maintaining iteration history.
Changes:
- Added
test-coverage-ralph.shbash script with iteration validation, Docker/pnpm dependency checks, and a structured prompt for Claude - Added
test-coverage-progress.txtas an append-only notes file for tracking coverage progress across iterations - Extended workflow tests to verify the helper script exists, is executable, and contains required guardrail text
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| workflows/test-coverage/test-coverage-ralph.sh | New helper script that runs iterative test coverage improvements using Claude in Docker sandbox with validation and error handling |
| workflows/test-coverage/test-coverage-progress.txt | New progress tracker template file for documenting test coverage improvements per iteration |
| tests/test-workflows.sh | Added tests to verify the helper script exists, is executable, and contains the "ONLY WRITE ONE TEST" guardrail, plus a test for the progress file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 3. Write ONE meaningful test that validates the feature works correctly for users. | ||
| 4. Run pnpm coverage again. Coverage should increase as a side effect of testing real behavior. | ||
| 5. Commit with message: test(<file>): <describe the user behavior being tested> | ||
| 6. Append super-concise notes to test-coverage-progress.txt: what you tested, coverage %, any learnings. |
There was a problem hiding this comment.
Inconsistent file path reference in the prompt. Earlier in the prompt (lines 31-32), the progress file is referenced with its full path via ${PROGRESS_FILE}, but here on line 48, it's referenced as just "test-coverage-progress.txt" without a path. This inconsistency could confuse Claude about which file to write to, especially if the script is run from a different directory. Consider changing this line to reference the full path consistently, e.g., "Append super-concise notes to ${PROGRESS_FILE}: what you tested, coverage %, any learnings."
| 6. Append super-concise notes to test-coverage-progress.txt: what you tested, coverage %, any learnings. | |
| 6. Append super-concise notes to ${PROGRESS_FILE}: what you tested, coverage %, any learnings. |
| @@ -0,0 +1,68 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Missing script documentation. Following the pattern used by other scripts in this codebase (like status.sh and stop.sh), this script should include a comment block after the shebang that describes what the script does and how to use it. Consider adding something like:
Test Coverage Ralph Helper
Runs an iterative test coverage improvement loop using Claude in a Docker sandbox
Usage: ./test-coverage-ralph.sh <iterations>
| #!/bin/bash | |
| #!/bin/bash | |
| # Test Coverage Ralph Helper | |
| # Runs an iterative test coverage improvement loop using Claude in a Docker sandbox | |
| # Usage: ./test-coverage-ralph.sh <iterations> |
| fi | ||
| exit 0 | ||
| fi | ||
| done |
There was a problem hiding this comment.
Missing user feedback when iterations complete without reaching 100% coverage. If the loop completes all iterations without Claude outputting the COMPLETE promise, the script exits silently with no message indicating whether the target was reached or more iterations are needed. Consider adding an informational message after line 68 to indicate that all iterations completed and suggest checking the progress file or running additional iterations if the coverage target hasn't been met.
| done | |
| done | |
| echo "Completed $1 iterations without receiving the <promise>COMPLETE</promise> signal." | |
| echo "Check $PROGRESS_FILE for current coverage status and run additional iterations if needed." |
| Use the notes from ${PROGRESS_FILE} as context for prior coverage progress. | ||
| WHAT MAKES A GREAT TEST: | ||
| A great test covers behavior users depend on. It tests a feature that, if broken, would frustrate or block users. | ||
| It validates real workflows not implementation details. It catches regressions before users do. |
There was a problem hiding this comment.
Missing comma in sentence. The sentence "It validates real workflows not implementation details" should have a comma after "workflows" to improve readability: "It validates real workflows, not implementation details."
| It validates real workflows not implementation details. It catches regressions before users do. | |
| It validates real workflows, not implementation details. It catches regressions before users do. |
The repository needed a
test-coverage-ralph.shscript that drives a one-test-per-iteration coverage loop and atest-coverage-progress.txttracker, matching the provided workflow prompt requirements. This PR adds those artifacts under theworkflows/test-coverage/workflow structure and ensures they are validated by existing workflow tests.Coverage loop helper script
workflows/test-coverage/test-coverage-ralph.shwith iteration validation, tooling checks, and a structured prompt for Claude sandbox runstest-coverage-progress.txtpath for contextProgress tracker artifact
workflows/test-coverage/test-coverage-progress.txtas the append-only notes target for iterationsWorkflow validation
Example snippet:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.