5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/fastlane/junit_generator.rb', line 5
def self.generate(results)
containing_folder = Fastlane::FastlaneFolder.path || Dir.pwd
path = File.join(containing_folder, "report.xml")
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
xml.testsuites(name: "fastlane") {
xml.testsuite(name: "deploy") {
results.each_with_index do |current, index|
xml.testcase(name: [index, current[:name]].join(": "), time: current[:time]) {
xml.failure(message: current[:error]) if current[:error]
xml.system_out current[:output] if current[:output]
}
end
}
}
end
result = builder.to_xml.gsub("system_", "system-").gsub("", " ")
File.write(path, result)
return path
end
|