Skip to content

Commit e0feb1e

Browse files
committed
junit support
1 parent 7d4064e commit e0feb1e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ Execute tests:
7878
$ bundle exec turbo_tests
7979
```
8080

81+
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.
82+
83+
```bash
84+
$ bundle exec turbo_tests -r rspec_junit_formatter
85+
```
86+
8187
Show help:
8288

8389
```bash

lib/turbo_tests/runner.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,21 @@ def start_subprocess(env, extra_args, tests, process_id, record_runtime:)
155155
[]
156156
end
157157

158+
junit_options = if defined?(RspecJunitFormatter)
159+
[
160+
"--format", "RspecJunitFormatter",
161+
"--out", "rspec/rspec#{process_id}.xml"
162+
]
163+
else
164+
[]
165+
end
166+
158167
command = [
159168
*command_name,
160169
*extra_args,
161170
*seed_option,
162171
"--format", "TurboTests::JsonRowsFormatter",
172+
*junit_options,
163173
*record_runtime_options,
164174
*tests,
165175
]

0 commit comments

Comments
 (0)