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 +4 -4
- data/CHANGELOG +4 -0
- data/README.markdown +7 -5
- data/junit_merge.gemspec +1 -1
- data/lib/junit_merge/app.rb +2 -2
- data/lib/junit_merge/version.rb +1 -1
- data/test/junit_merge/test_app.rb +12 -0
- data/test/template.xml.erb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9009e2072ef14939b52f9030fabba9641c543dc
|
4
|
+
data.tar.gz: a72084ddc5e3af79aef60c6719e941ec4ef6012c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 064109a7a89903bae29547e66e9ca25655f7ced93e8917cea5a45f7ed75673d8751fc705479016838a9ffa084e7ccf18b192b4cebb01b07f655ff40824a6ef2f
|
7
|
+
data.tar.gz: 7a99474577297b24989f83d8336aa3bb178e6b80d6aa46c226c01773c791061abf26b8f9da64530c13afde967d3559f68d5ebae18aa166ead09214fbac97febe
|
data/CHANGELOG
CHANGED
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
|
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
|
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")
|
data/lib/junit_merge/app.rb
CHANGED
@@ -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
|
data/lib/junit_merge/version.rb
CHANGED
@@ -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
|
data/test/template.xml.erb
CHANGED
@@ -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
|
-
|
5
|
+
<% name = name.dup.force_encoding('ASCII-8BIT') %>
|
6
|
+
<% class_name, test_name = name.gsub('"', '"').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.
|
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-
|
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:
|