Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ Execute tests:
$ bundle exec turbo_tests
```

To enable support for RSpec Junit formatting (ie for CircleCI), include `rspec_junit_formatter` in Gemfile, and pass the `-r rspec_junit_formatter` option. Output will be written to `rspec/rspec#{TEST_ENV_NUMBER}.xml` files. Update your Circle CI config:

```yml
# .circleci/config.yml
- run:
name: RSpec
command: bundle exec turbo_tests -r rspec_junit_formatter
- store_test_results:
path: rspec
```

Show help:

```bash
Expand Down
10 changes: 10 additions & 0 deletions lib/turbo_tests/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,21 @@ def start_subprocess(env, extra_args, tests, process_id, record_runtime:)
[]
end

junit_options = if defined?(RspecJunitFormatter)
[
"--format", "RspecJunitFormatter",
"--out", "rspec/rspec#{process_id}.xml"
]
else
[]
end

command = [
*command_name,
*extra_args,
*seed_option,
"--format", "TurboTests::JsonRowsFormatter",
*junit_options,
*record_runtime_options,
*tests,
]
Expand Down