Sha256: cce7f1bcce7864485795d2e9ba888e20a20964c383825deec83437f17ceebbd5

Contents?: true

Size: 982 Bytes

Versions: 13

Compression:

Stored size: 982 Bytes

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/

      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

13 entries across 13 versions & 1 rubygems

Version Path
fastlane-1.56.0 lib/fastlane/junit_generator.rb
fastlane-1.55.0 lib/fastlane/junit_generator.rb
fastlane-1.54.0 lib/fastlane/junit_generator.rb
fastlane-1.53.0 lib/fastlane/junit_generator.rb
fastlane-1.52.0 lib/fastlane/junit_generator.rb
fastlane-1.51.0 lib/fastlane/junit_generator.rb
fastlane-1.50.0 lib/fastlane/junit_generator.rb
fastlane-1.49.0 lib/fastlane/junit_generator.rb
fastlane-1.48.0 lib/fastlane/junit_generator.rb
fastlane-1.47.0 lib/fastlane/junit_generator.rb
fastlane-1.46.1 lib/fastlane/junit_generator.rb
fastlane-1.46.0 lib/fastlane/junit_generator.rb
fastlane-1.45.0 lib/fastlane/junit_generator.rb