junit_merge 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe328cd3a59857e1ae738c399c84d07c08de49f2
4
- data.tar.gz: fb6a05b5e0f3de689191ae90b7396bf1bb96cd43
3
+ metadata.gz: e9009e2072ef14939b52f9030fabba9641c543dc
4
+ data.tar.gz: a72084ddc5e3af79aef60c6719e941ec4ef6012c
5
5
  SHA512:
6
- metadata.gz: 4ba9e33377decf1b3d48de892f042f89b47f67e6c261a320701f111d3ef5f3acf9a3872cbe210bcdd96ea21c1df2735d5d97622ced06281460282db37a7cdb56
7
- data.tar.gz: c4d6a895d587d93552b086545372c46f0a7852c07e0d6179acd572f4ba670932e144f8295bacbeede71692a11bdd35281f1d3eb7e08f7e7b52d602e5f572a92a
6
+ metadata.gz: 064109a7a89903bae29547e66e9ca25655f7ced93e8917cea5a45f7ed75673d8751fc705479016838a9ffa084e7ccf18b192b4cebb01b07f655ff40824a6ef2f
7
+ data.tar.gz: 7a99474577297b24989f83d8336aa3bb178e6b80d6aa46c226c01773c791061abf26b8f9da64530c13afde967d3559f68d5ebae18aa166ead09214fbac97febe
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.1.2 2014-05-25
2
+
3
+ * Invalid UTF-8 does not crash junit_merge.
4
+
1
5
  == 0.1.1 2014-04-18
2
6
 
3
7
  * Merging directories with --update-only shouldn't add files only in the source.
data/README.markdown CHANGED
@@ -1,7 +1,7 @@
1
1
  ## JUnit Merge
2
2
 
3
- Merges two JUnit XML reports, such that results from one run may override those
4
- in the other. Reports may be single files or directory trees.
3
+ Merges two or more JUnit XML reports, such that results from one run may
4
+ override those in the other. Reports may be single files or directory trees.
5
5
 
6
6
  ## Usage
7
7
 
@@ -11,10 +11,12 @@ Install:
11
11
 
12
12
  Run:
13
13
 
14
- junit_merge SOURCE.xml TARGET.xml
14
+ junit_merge SOURCE1.xml SOURCE2.xml ... TARGET.xml
15
15
 
16
- Test results in SOURCE.xml will overwrite their counterparts in
17
- TARGET.xml. Summary statistics will be updated as necessary.
16
+ Test results in SOURCE[1..n].xml will overwrite their counterparts in
17
+ TARGET.xml. Summary statistics will be updated as necessary. The sources and
18
+ target may be directories -- files at the same relative paths under each will be
19
+ merged (recursively).
18
20
 
19
21
  ## Why?
20
22
 
data/junit_merge.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
8
8
  gem.email = ['george.ogata@gmail.com']
9
9
  gem.description = "Tool to merge JUnit XML reports."
10
10
  gem.summary = ""
11
- gem.homepage = ''
11
+ gem.homepage = 'https://github.com/oggy/junit_merge'
12
12
 
13
13
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
14
14
  gem.files = `git ls-files`.split("\n")
@@ -53,8 +53,8 @@ module JunitMerge
53
53
  private
54
54
 
55
55
  def merge_file(source_path, target_path)
56
- source_text = File.read(source_path)
57
- target_text = File.read(target_path)
56
+ source_text = File.read(source_path).encode!('UTF-8', invalid: :replace)
57
+ target_text = File.read(target_path).encode!('UTF-8', invalid: :replace)
58
58
 
59
59
  if target_text =~ /\A\s*\z/m
60
60
  return
@@ -1,5 +1,5 @@
1
1
  module JunitMerge
2
- VERSION = [0, 1, 1]
2
+ VERSION = [0, 1, 2]
3
3
 
4
4
  class << VERSION
5
5
  include Comparable
@@ -189,6 +189,18 @@ describe JunitMerge::App do
189
189
  stderr.string.must_equal('')
190
190
  end
191
191
 
192
+ it "works around invalid UTF-8" do
193
+ create_file("#{tmp}/source.xml", "a.a\xFFb" => :pass)
194
+ create_file("#{tmp}/target.xml", "a.a\xFFb" => :fail)
195
+ app.run("#{tmp}/source.xml", "#{tmp}/target.xml").must_equal 0
196
+
197
+ document = parse_file("#{tmp}/target.xml")
198
+ results(document).must_equal([["a.a\uFFFDb", :pass]])
199
+
200
+ stdout.string.must_equal('')
201
+ stderr.string.must_equal('')
202
+ end
203
+
192
204
  it "whines if the source does not exist" do
193
205
  FileUtils.touch "#{tmp}/target.xml"
194
206
  app.run("#{tmp}/source.xml", "#{tmp}/target.xml").must_equal 1
@@ -2,7 +2,8 @@
2
2
  <testsuite tests="<%= num_tests %>" failures="<%= num_failures %>" errors="<%= num_errors %>" skipped="<%= num_skipped %>" time="0.000001" timestamp="2014-04-10T14:29:06-04:00">
3
3
  <properties/>
4
4
  <% tests.each do |name, result| %>
5
- <% class_name, test_name = name.gsub('"', '&quot;').split('.') %>
5
+ <% name = name.dup.force_encoding('ASCII-8BIT') %>
6
+ <% class_name, test_name = name.gsub('"', '&quot;').split('.') %>
6
7
  <testcase classname="<%= class_name %>" name="<%= test_name %>" time="0.000001">
7
8
  <% if result == :fail %>
8
9
  <failure message="MESSAGE" type="TYPE">
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junit_merge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Ogata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-18 00:00:00.000000000 Z
11
+ date: 2014-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -66,7 +66,7 @@ files:
66
66
  - test/junit_merge/test_app.rb
67
67
  - test/template.xml.erb
68
68
  - test/test_helper.rb
69
- homepage: ''
69
+ homepage: https://github.com/oggy/junit_merge
70
70
  licenses: []
71
71
  metadata: {}
72
72
  post_install_message: