Shopify / erb-lint

Lint your ERB or HTML files
MIT License
593 stars 114 forks source link

Added JUnit.xml support via --format junit #296

Closed wscourge closed 1 year ago

wscourge commented 1 year ago

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.

image
etiennebarrie commented 1 year ago

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 lineno attribute: https://github.com/Shopify/ci-queue/blob/941e4fe39a5bfdfc3bb8c0ec2c5a0dfa71075c3e/ruby/lib/minitest/queue/junit_reporter.rb#L77

wscourge commented 1 year ago

Sure thing, I'll look into it - thanks.

mikoto2000 commented 1 year ago

@wscourge @etiennebarrie May I take over and continue with this pull request? I will to respond to the comments and modify it to use REXML.

wscourge commented 1 year ago

@mikoto2000 fine by me, thanks for doing this, and sorry for my negligence. Cheers.

mikoto2000 commented 1 year ago

@wscourge Thank you. I will fork wscourge:main and create new pull request.

wscourge commented 1 year ago

OK, closing this one