Sha256: a7d92812744a02d1f3b23b950e191d86784163dc5a55caf5c53ae082405f1ded

Contents?: true

Size: 1.04 KB

Versions: 297

Compression:

Stored size: 1.04 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) # https://web.archive.org/web/20160430190141/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

297 entries across 297 versions & 1 rubygems

Version Path
fastlane-2.114.0.beta.20190114200053 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.114.0.beta.20190113200019 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.114.0.beta.20190112200032 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.114.0.beta.20190111200053 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.114.0.beta.20190110200051 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.114.0.beta.20190109200053 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.114.0.beta.20190108200048 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20190107200010 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20190106200016 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20190105200036 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20190104200013 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20190103200013 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20190102200016 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20190101200013 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20181231200027 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20181230200014 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20181229200101 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20181228200027 fastlane/lib/fastlane/junit_generator.rb
fastlane-2.113.0.beta.20181227200058 fastlane/lib/fastlane/junit_generator.rb