Permalink
Browse files

Restored types to error elements, added TEST to filenames

Trying to be consistent with other ci integration tools
  • Loading branch information...
1 parent 5e582b3 commit 22ddb909cbd69d1c9e3917ab48d9d2581d7d498c @bensomers bensomers committed Apr 11, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/minitest/reporters/junit_reporter.rb
@@ -51,13 +51,13 @@ def xml.trunc!(txt)
case test_runner.result
when :skip
- xml.skipped
+ xml.skipped(:type => test)
when :error
- xml.error(:message => xml.trunc!(e.message)) do
+ xml.error(:type => test, :message => xml.trunc!(e.message)) do
xml.text!(message_for(test_runner))
end
when :failure
- xml.failure(:message => xml.trunc!(e.message)) do
+ xml.failure(:type => test, :message => xml.trunc!(e.message)) do
xml.text!(message_for(test_runner))
end
end
@@ -100,10 +100,10 @@ def analyze_suite(suite, tests)
def filename_for(suite)
file_counter = 0
- filename = "#{suite.to_s[0..245]}.xml" #restrict max filename length, to be kind to filesystems
+ filename = "TEST-#{suite.to_s[0..240]}.xml" #restrict max filename length, to be kind to filesystems
while File.exists?(filename) # restrict number of tries, to avoid infinite loops
file_counter += 1
- filename = "#{suite}-#{file_counter}.xml"
+ filename = "TEST-#{suite}-#{file_counter}.xml"
p "Too many duplicate files, overwriting earlier report #{filename}" and break if file_counter >= 99
end
File.join(@reports_path, filename)

0 comments on commit 22ddb90

Please sign in to comment.