Skip to content

Commit a4be0d5

Browse files
etagwerkerclaude
andcommitted
Add TESTING.md, install gems in CI
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent c3a5492 commit a4be0d5

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ jobs:
1515
- uses: ruby/setup-ruby@v1
1616
with:
1717
ruby-version: '3.4'
18+
bundler-cache: true
1819
- run: bundle exec rake test

‎TESTING.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# End-to-end testing
2+
3+
Run against [fastruby/rubycritic-action-sandbox](https://github.com/fastruby/rubycritic-action-sandbox), using this action from the `dev` branch. Results were checked through the API (`gh api`), not just in the UI.
4+
5+
| Scenario | PR | Run | Expected | Actual |
6+
|---|---|---|---|---|
7+
| A: clean refactor (method moved) | [#1](https://github.com/fastruby/rubycritic-action-sandbox/pull/1) | [run](https://github.com/fastruby/rubycritic-action-sandbox/actions/runs/43546131041) | No inline comments, summary says no new smells | Pass. 0 review comments, 1 summary, score 98.87 to 98.87 |
8+
| B: new smells | [#2](https://github.com/fastruby/rubycritic-action-sandbox/pull/2) | [run](https://github.com/fastruby/rubycritic-action-sandbox/actions/runs/43546133881) | Inline comments on new lines, score diff, one summary | Pass. 10 inline comments, score 98.87 to 95.55 (-3.32) |
9+
| B: second push | [#2](https://github.com/fastruby/rubycritic-action-sandbox/pull/2) | [run](https://github.com/fastruby/rubycritic-action-sandbox/actions/runs/43546281589) | One summary (updated), no duplicate inline comments | Pass. Still 1 summary (updated to -3.48), 13 inline comments with 13 unique markers (only the 3 new smells were added) |
10+
| C: smell outside the diff | [#3](https://github.com/fastruby/rubycritic-action-sandbox/pull/3) | [run](https://github.com/fastruby/rubycritic-action-sandbox/actions/runs/43546140217) | Finding in the summary, not inline | Pass. `Report#build` "got worse" (8 to 10 statements) reported at the unchanged `def` line in the summary table, 0 review comments |
11+
| D: threshold 0 | [#4](https://github.com/fastruby/rubycritic-action-sandbox/pull/4) | [run](https://github.com/fastruby/rubycritic-action-sandbox/actions/runs/43546144054) | Job fails after comments are posted | Pass. Job failed, 10 inline comments and the summary were present |
12+
| E: read-only token | [#5](https://github.com/fastruby/rubycritic-action-sandbox/pull/5) | [run](https://github.com/fastruby/rubycritic-action-sandbox/actions/runs/43546150671) | Annotations and job summary, no write errors | Pass. Job succeeded, 10 warning annotations (the cap), no PR comments |
13+
| Slash in head branch | [#2](https://github.com/fastruby/rubycritic-action-sandbox/pull/2) | same as B | Reports found | Pass. PR branches are `feature/add-smells`, `refactor/move-method`, etc. The action compares fixed local branches, so nested report paths never occur in CI. A local run with a nested head branch (`compare/feature/add-smells/report.json`) was parsed correctly, and `Report.find` has a unit test for it |
14+
15+
## Notes
16+
17+
- A fork PR was simulated with `pull-requests: read`, as in the brief. A real fork PR was not opened.
18+
- Checked locally against RubyCritic 5.0.0: `-b`, repeated `-f`, `-p` and `-t` behave as the brief describes, the working tree stays clean, and a threshold failure still writes the reports.

0 commit comments

Comments
 (0)