sj26 / rspec_junit_formatter

RSpec results that your CI can read
http://rubygems.org/gems/rspec_junit_formatter
MIT License
302 stars 122 forks source link

Invalid XML file while using rspec_junit_formatter with parallel_rspec #97

Closed ghost closed 2 years ago

ghost commented 2 years ago

rspec_junit_formatter sometimes generates an invalid XML file when run parallel_rspec in https://github.com/ably/ably-ruby/pull/368/files

bundle exec parallel_rspec --prefix-output-with-test-env-number -- --format documentation --format RspecJunitFormatter --out out.junit -- spec/
...
<testcase classname="spec.acceptance.realtime.auth_spec" name="Ably::Realtime::Auth using JSON protocol #auth_header_sync returns an auth header synchronously" file="./spec/acceptance/realtime/auth_spec.rb" time="0.155041"></testcase>
<testcase classname="spec.acceptance.realtime.auth_spec" name="Ably::Realtime::Auth using JSON protocol #auth_params_sync returns the auth params synchronously" file="./spec/acceptance/realtime/auth_spec.rb" time="0.155531"></testcase>
</testsuite>
g JSON protocol encoding and decoding encrypted messages with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d) item 4 with encrypted encoding cipher+aes-256-cbc/base64 behaves like an Ably encrypter and decrypter with #publish and #subscribe sends and receives messages that are encrypted &amp; decrypted by the Ably library (#RTL7d)" file="./spec/acceptance/realtime/message_spec.rb" time="0.547798"></testcase>
<testcase classname="spec.acceptance.realtime.message_spec" name="Ably::Realtime::Channel Message using JSON protocol encoding and decoding encrypted messages with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d) item 70 with encrypted encoding cipher+aes-256-cbc/base64 behaves like an Ably encrypter and decrypter with #publish and #subscribe sends and receives messages that are encrypted &amp; decrypted by the Ably library (#RTL7d)" file="./spec/acceptance/realtime/message_spec.rb" time="0.544192"></testcase>
<testcase classname="spec.acceptance.realtime.message_spec" name="Ably::Realtime::Channel Message using JSON protocol encoding and decoding encrypted messages with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d) item 70 with encrypted encoding cipher+aes-256-cbc/base64 behaves like an Ably encrypter and decrypter with #publish and #subscribe encrypts message automatically before they are pushed to the server (#RTL7d)" file="./spec/acceptance/realtime/message_spec.rb" time="0.623424"></testcase>
<testcase classname="spec.acceptance.realtime.message_spec" name="Ably::Realtime::Channel Message using JSON protocol encoding and decoding encrypted messages with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d) item 49 with encrypted encoding cipher+aes-256-cbc/base64 behaves like an Ably encrypter and decrypter with #publish and #subscribe encrypts message automatically before they are pushed to the server (#RTL7d)" file="./spec/acceptance/realtime/message_spec.rb" time="0.627041"></testcase>
<testcase classname="spec.acceptance.realtime.message_spec" name="Ably::Realtime::Channel Message using JSON protocol encoding and decoding encrypted messages with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d) item 49 with encrypted encoding cipher+aes-256-cbc/base64 behaves like an Ably encrypter and decrypter with #publish and #subscribe sends and receives messages that are encrypted &amp; decrypted by the Ably library (#RTL7d)" file="./spec/acceptance/realtime/message_spec.rb" time="0.555929"></testcase>
<testcase classname="spec.acceptance.realtime.message_spec" name="Ably::Realtime::Channel Message using JSON protocol encoding and decoding encrypted messages with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d) item 43 with encrypted encoding cipher+aes-256-cbc/base64 behaves like an Ably encrypter and decrypter with #publish and #subscribe encrypts message automatically before they are pushed to the server (#RTL7d)" file="./spec/acceptance/realtime/message_spec.rb" time="0.620871"></testcase>
....

json-acceptance-ruby-2.7.junit.txt

json-acceptance-ruby-2.7-2.junit.txt

sj26 commented 2 years ago

This is built as an output formatter for rspec, you might need to dig into how parallel_rspec composes rspect formatters and their output to make this work nicely. I don't want to add support for parallel_rspec to this gem, sorry.

magni- commented 1 year ago

Related: https://github.com/grosser/parallel_tests/wiki#with-rspec_junit_formatter----by-jgarber