Sha256: 91d4d6085ca7e38f4e84d40cf080eb668d690e1ea2eb8ed5177cbb3bf7bd661c

Contents?: true

Size: 745 Bytes

Versions: 1

Compression:

Stored size: 745 Bytes

Contents

module JunitModel
  module CLI
    # Merge JUnit xml files from the command line
    class Merger
      def self.merge(options)
        path_a = options.files[0]
        path_b = options.files[1]
        output_path = options.output_path

        test_a = JunitModel::Parser.read_path(path_a)
        test_b = JunitModel::Parser.read_path(path_b)

        merged_tests = JunitModel::Merger.merge(test_a, test_b)
        puts "Merged #{path_a} and #{path_b} to #{output_path}"
        puts "Tests:#{merged_tests.tests} Failures:#{merged_tests.failure_count} Suites:#{merged_tests.test_suites.count}"
        xml = merged_tests.to_xml
        File.open(output_path, 'w') do |file|
          file.write(xml)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
junit_model-0.1.1 lib/junit_model/cli/cli_merger.rb