-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added JUnit.xml support via --format junit #296
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using REXML, that's part of the standard library, to generate the XML, assert the generated values in test?
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
require "pry" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes the test file to fail.
<property name="erb_lint_version" value="0.3.1" /> | ||
<property name="ruby_engine" value="ruby" /> | ||
<property name="ruby_version" value="3.1.2" /> | ||
<property name="ruby_patchlevel" value="20" /> | ||
<property name="ruby_platform" value="arm64-darwin21" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These fail the test unless we're using the exact same ruby version as you did.
Here's an example of using REXML https://github.com/Shopify/ci-queue/blob/941e4fe39a5bfdfc3bb8c0ec2c5a0dfa71075c3e/ruby/lib/minitest/queue/junit_reporter.rb Testing your branch worked well in Buildkite as well, but one thing I noticed is that the line number is missing. According to that code, it seems like you can add a |
Sure thing, I'll look into it - thanks. |
@wscourge @etiennebarrie |
@mikoto2000 fine by me, thanks for doing this, and sorry for my negligence. Cheers. |
@wscourge Thank you. I will fork wscourge:main and create new pull request. |
OK, closing this one |
Addresses #295.
Shamelessly based on sj26/rspec_junit_formatter. I additionally validated the
spec/erb_lint/fixtures/junit.xml
with xmlvalidation.com for a good measure.This is a minimal example, without timings and hostnames, but good enough to display this test summary on GitlabCI, and I assume on other CI interfaces as well.