Sha256: 4e6a97217f4332f4ff42fb8b7948325fe20bbce5c98ae2d85565884686ccbebc

Contents?: true

Size: 1.02 KB

Versions: 43

Compression:

Stored size: 1.02 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'] || Fastlane::FastlaneFolder.path || Dir.pwd
      path = File.join(containing_folder, 'report.xml')

      @steps = results
      xml_path = File.join(lib_path, "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

      File.write(path, xml)

      return path
    end

    def self.lib_path
      if !Helper.is_test? and Gem::Specification.find_all_by_name('fastlane').any?
        return [Gem::Specification.find_by_name('fastlane').gem_dir, 'lib'].join('/')
      else
        return './lib'
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
fastlane-1.99.0 lib/fastlane/junit_generator.rb
fastlane-1.98.0 lib/fastlane/junit_generator.rb
fastlane-1.97.2 lib/fastlane/junit_generator.rb
fastlane-1.97.1 lib/fastlane/junit_generator.rb
fastlane-1.97.0 lib/fastlane/junit_generator.rb
fastlane-1.96.0 lib/fastlane/junit_generator.rb
fastlane-1.95.0 lib/fastlane/junit_generator.rb
fastlane-1.94.1 lib/fastlane/junit_generator.rb
fastlane-1.94.0 lib/fastlane/junit_generator.rb
fastlane-1.93.1 lib/fastlane/junit_generator.rb
fastlane-1.93.0 lib/fastlane/junit_generator.rb
fastlane-1.92.0 lib/fastlane/junit_generator.rb
fastlane-1.92.0.beta2 lib/fastlane/junit_generator.rb
fastlane-1.92.0.beta1 lib/fastlane/junit_generator.rb
fastlane-1.91.0 lib/fastlane/junit_generator.rb
fastlane-1.90.0 lib/fastlane/junit_generator.rb
fastlane-1.89.0 lib/fastlane/junit_generator.rb
fastlane-1.88.0 lib/fastlane/junit_generator.rb
fastlane-1.87.1 lib/fastlane/junit_generator.rb
fastlane-1.87.0 lib/fastlane/junit_generator.rb