Sha256: 011546f5618d5130aadee0a5c8c80b4bbddb81757f75e3bd987aba9ea024e5c7

Contents?: true

Size: 1 KB

Versions: 139

Compression:

Stored size: 1 KB

Contents

module Fastlane
  class JUnitGenerator
    def self.generate(results)
      # JUnit file documentation: http://llg.cubic.org/docs/junit/
      # And http://nelsonwells.net/2012/09/how-jenkins-ci-parses-and-displays-junit-output/
      # And http://windyroad.com.au/dl/Open%20Source/JUnit.xsd

      containing_folder = ENV['FL_REPORT_PATH'] || FastlaneCore::FastlaneFolder.path || Dir.pwd
      path = File.join(containing_folder, 'report.xml')

      @steps = results
      xml_path = File.join(Fastlane::ROOT, "lib/assets/report_template.xml.erb")
      xml = ERB.new(File.read(xml_path)).result(binding) # http://www.rrn.dk/rubys-erb-templating-system

      xml = xml.gsub('system_', 'system-').delete("\e") # Jenkins can not parse 'ESC' symbol

      begin
        File.write(path, xml)
      rescue => ex
        UI.error(ex)
        UI.error("Couldn't save report.xml at path '#{File.expand_path(output_path)}', make sure you have write access to the containing directory.")
      end

      return path
    end
  end
end

Version data entries

139 entries across 139 versions & 1 rubygems

Version Path
fastlane-2.65.0.beta.20171116010004 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.65.0.beta.20171115010004 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.65.0.beta.20171114010003 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.64.1 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.65.0.beta.20171113010004 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.65.0.beta.20171112010003 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.65.0.beta.20171111010004 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.65.0.beta.20171110010003 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.65.0.beta.20171109010003 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.65.0.beta.20171108010003 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.65.0.beta.20171107010003 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.64.0 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.64.0.beta.20171106010003 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.64.0.beta.20171105010003 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.64.0.beta.20171104010004 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.64.0.beta.20171103010004 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.64.0.beta.20171102010003 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.64.0.beta.20171101010004 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.63.0 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.63.0.beta.20171031010003 fastlane/lib/fastlane/junit_generator.rb