Skip to content

Commit 6209806

Browse files
committed
Enable SimpleCov coverage reporting in CI
Set COVERAGE=true in GitHub Actions workflow to enable SimpleCov coverage reporting in CI. This works with the conditional SimpleCov loading in spec_helper.rb.
1 parent 8dcbed7 commit 6209806

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/ruby.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
BUNDLE_IGNORE_FUNDING_REQUESTS: true
1818
BUNDLE_IGNORE_MESSAGES: true
1919
RAILS_ENV: test
20+
COVERAGE: true
2021
PARALLEL_TEST_PROCESSORS: ${{ matrix.ci_node_total }}
2122
services:
2223
postgres:

AGENTS.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ codebar planner is a Rails 8.1 application for managing [codebar.io](https://cod
3131

3232
- **Setup**: `bundle && rake db:create db:migrate db:seed`
3333
- **Server**: `bundle exec rails server`
34-
- **Tests**: `bundle exec rspec [path]` - runs RSpec tests, optionally for specific file/line
34+
- **Tests**: `make test` or `bundle exec parallel_rspec spec/ -n 3` - runs RSpec tests in parallel (3 processes is optimal)
35+
- **Single test**: `bundle exec rspec spec/path/to/file_spec.rb:42`
3536
- **Rails console**: `bundle exec rails console`
3637
- **Run rake tasks**: `bundle exec rake [task]`
3738
- **Linting**: `bundle exec rubocop`
@@ -129,14 +130,15 @@ See `app/models/README.md` for detailed data model documentation.
129130
- **JavaScript Driver**: Playwright (Chromium by default)
130131
- **Factories**: Fabrication (not FactoryBot)
131132
- **Test data**: Faker for generated data
132-
- **Coverage**: SimpleCov
133+
- **Coverage**: SimpleCov (runs in CI when COVERAGE=true)
134+
- **Parallel testing**: Use `make test` or `bundle exec parallel_rspec spec/ -n 3` for ~45% faster test runs
133135
- **JavaScript tests**: Capybara with Playwright driver
134136
- Use `PLAYWRIGHT_HEADLESS=false` to debug with visible browser
135137
- Use `PWDEBUG=1` for Playwright Inspector (step-through debugging)
136138
- Use `PLAYWRIGHT_BROWSER=firefox` or `webkit` for cross-browser testing
137139
- **Matchers**: Shoulda Matchers, RSpec Collection Matchers
138140

139-
Run single test: `bin/drspec spec/path/to/file_spec.rb:42`
141+
Run single test: `bundle exec rspec spec/path/to/file_spec.rb:42`
140142

141143
## Code Style
142144

0 commit comments

Comments
 (0)