lib/junit/plugin.rb in danger-junit-0.6.1 vs lib/junit/plugin.rb in danger-junit-0.6.3
- old
+ new
@@ -4,11 +4,12 @@
# Testing frameworks have standardized on the JUnit XML format for
# reporting results, this means that projects using Rspec, Jasmine, Mocha,
# XCTest and more - can all use the same Danger error reporting. Perfect.
#
# You can see some examples on [this page from Circle CI](https://circleci.com/docs/test-metadata/)
- # about how you can add JUnit XML output for your testing projects.
+ # and on this [project's README](https://github.com/orta/danger-junit.git) about how you
+ # can add JUnit XML output for your testing projects.
#
# @example Parse the XML file, and let the plugin do your reporting
#
# junit.parse "/path/to/output.xml"
# junit.report
@@ -94,13 +95,11 @@
failed_suites = suite_root.nodes.select { |suite| suite[:failures].to_i > 0 || suite[:errors].to_i > 0 }
failed_tests = failed_suites.map(&:nodes).flatten.select { |node| node.value == 'testcase' }
@failures = failed_tests.select { |test| test.nodes.count > 0 }.select { |test| test.nodes.first.value == 'failure' }
-
@errors = failed_tests.select { |test| test.nodes.count > 0 }.select { |test| test.nodes.first.value == 'error' }
-
@skipped = tests.select { |test| test.nodes.count > 0 }.select { |test| test.nodes.first.value == 'skipped' }
@passes = tests - @failures - @errors - @skipped
end
@@ -135,10 +134,10 @@
private
def auto_link(value)
if File.exist?(value) && defined?(@dangerfile.github)
- github.html_link value
+ github.html_link(value, full_path: false)
else
value
end
end
end