Commit b659390
Fix bin/ci-run-failed-specs to handle bare spec paths (#1989)
## Summary
Fixes the `bin/ci-run-failed-specs` script to handle bare spec paths
that users might copy directly from their terminal, like
`spec/system/integration_spec.rb[1:1:6:1:2]%`.
Previously, the script only recognized the format `rspec ./spec/...` and
would fail with "No specs found!" when given bare spec paths.
## Changes
- Added regex pattern to match bare spec paths (with or without `./`
prefix)
- Strip trailing `%` characters from spec paths (common in shell output)
- Normalize all paths to `./spec/` format for consistency
- Improved TTY detection to avoid spurious error messages when piping
input
- Auto-confirm when TTY is unavailable instead of failing
## Test Plan
The script now correctly handles all these input formats:
- `spec/foo.rb[1:2:3]%` (bare with trailing %)
- `./spec/foo.rb[1:2:3]` (with ./ prefix)
- `rspec ./spec/foo.rb[1:2:3]` (full rspec command format)
Tested with:
```bash
echo "spec/system/integration_spec.rb[1:1:6:1:2]%" | bin/ci-run-failed-specs
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/shakacode/react_on_rails/1989)
<!-- Reviewable:end -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Enhanced CI test runner to better handle test file path formats
* Improved user confirmation prompts for automated CI environments
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8a977b3 commit b659390
1 file changed
+25
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
108 | 117 | | |
109 | 118 | | |
110 | 119 | | |
| |||
153 | 162 | | |
154 | 163 | | |
155 | 164 | | |
| 165 | + | |
156 | 166 | | |
157 | 167 | | |
158 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
159 | 183 | | |
160 | 184 | | |
161 | 185 | | |
| |||
0 commit comments