ci_reporter 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/LICENSE.txt +1 -1
- data/README.txt +1 -5
- data/Rakefile +7 -2
- data/lib/ci/reporter/core.rb +2 -2
- data/lib/ci/reporter/cucumber.rb +1 -1
- data/lib/ci/reporter/rake/cucumber.rb +1 -1
- data/lib/ci/reporter/rake/cucumber_loader.rb +2 -2
- data/lib/ci/reporter/rake/rspec.rb +1 -1
- data/lib/ci/reporter/rake/rspec_loader.rb +2 -2
- data/lib/ci/reporter/rake/test_unit.rb +1 -1
- data/lib/ci/reporter/rake/test_unit_loader.rb +2 -2
- data/lib/ci/reporter/report_manager.rb +2 -2
- data/lib/ci/reporter/rspec.rb +2 -1
- data/lib/ci/reporter/test_suite.rb +17 -7
- data/lib/ci/reporter/test_unit.rb +2 -2
- data/lib/ci/reporter/version.rb +1 -1
- data/spec/ci/reporter/cucumber_spec.rb +1 -1
- data/spec/ci/reporter/output_capture_spec.rb +2 -2
- data/spec/ci/reporter/rake/rake_tasks_spec.rb +1 -1
- data/spec/ci/reporter/report_manager_spec.rb +2 -2
- data/spec/ci/reporter/rspec_spec.rb +1 -1
- data/spec/ci/reporter/test_suite_spec.rb +4 -3
- data/spec/ci/reporter/test_unit_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- data/stub.rake +1 -1
- data/tasks/ci_reporter.rake +1 -1
- metadata +23 -10
data/History.txt
CHANGED
data/LICENSE.txt
CHANGED
data/README.txt
CHANGED
@@ -10,10 +10,6 @@ CI::Reporter is available as a gem. To install the gem, use the usual gem comman
|
|
10
10
|
|
11
11
|
gem install ci_reporter
|
12
12
|
|
13
|
-
To use CI::Reporter as a Rails plugin, first install the gem, and then install the plugin as follows:
|
14
|
-
|
15
|
-
script/plugin install http://svn.caldersphere.net/svn/main/plugins/ci_reporter
|
16
|
-
|
17
13
|
== Usage
|
18
14
|
|
19
15
|
CI::Reporter works best with projects that use a +Rakefile+ along with the standard <code>Rake::TestTask</code> or <code>Spec::Rake::SpecTask</code> tasks for running tests or examples, respectively. In this fashion, it hooks into <code>Test::Unit</code> or +RSpec+ using environment variables recognized by these custom tasks to inject the CI::Reporter code into the test or spec runs. If you're using the Rails plugin, step 1 is unnecessary; skip to step 2.
|
@@ -64,7 +60,7 @@ There's a bit of a chicken and egg problem because rubygems needs to be loaded b
|
|
64
60
|
|
65
61
|
You can get the CI::Reporter source using Git, in any of the following ways:
|
66
62
|
|
67
|
-
git clone
|
63
|
+
git clone git://git.caldersphere.net/ci_reporter.git
|
68
64
|
git clone git://github.com/nicksieger/ci_reporter.git
|
69
65
|
|
70
66
|
You can also download a tarball of the latest CI::Reporter source at http://github.com/nicksieger/ci_reporter/tree/master.
|
data/Rakefile
CHANGED
@@ -8,7 +8,8 @@ begin
|
|
8
8
|
File.open("Manifest.txt", "w") {|f| MANIFEST.each {|n| f << "#{n}\n"} }
|
9
9
|
require 'hoe'
|
10
10
|
require File.dirname(__FILE__) + '/lib/ci/reporter/version'
|
11
|
-
hoe = Hoe.
|
11
|
+
hoe = Hoe.spec("ci_reporter") do |p|
|
12
|
+
p.version = CI::Reporter::VERSION
|
12
13
|
p.rubyforge_name = "caldersphere"
|
13
14
|
p.url = "http://caldersphere.rubyforge.org/ci_reporter"
|
14
15
|
p.author = "Nick Sieger"
|
@@ -28,7 +29,11 @@ end
|
|
28
29
|
|
29
30
|
# Hoe insists on setting task :default => :test
|
30
31
|
# !@#$ no easy way to empty the default list of prerequisites
|
31
|
-
|
32
|
+
# Leave my tasks alone, Hoe
|
33
|
+
%w(default spec rcov).each do |task|
|
34
|
+
Rake::Task[task].prerequisites.clear
|
35
|
+
Rake::Task[task].actions.clear
|
36
|
+
end
|
32
37
|
|
33
38
|
# No RCov on JRuby at the moment
|
34
39
|
if RUBY_PLATFORM =~ /java/
|
data/lib/ci/reporter/core.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
5
5
|
require 'ci/reporter/test_suite'
|
6
|
-
require 'ci/reporter/report_manager'
|
6
|
+
require 'ci/reporter/report_manager'
|
data/lib/ci/reporter/cucumber.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
5
5
|
$: << File.dirname(__FILE__) + "/../../.."
|
6
|
-
require 'ci/reporter/cucumber'
|
6
|
+
require 'ci/reporter/cucumber'
|
@@ -1,6 +1,6 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
5
5
|
$: << File.dirname(__FILE__) + "/../../.."
|
6
|
-
require 'ci/reporter/rspec'
|
6
|
+
require 'ci/reporter/rspec'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
@@ -18,4 +18,4 @@ module Test #:nodoc:all
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
@@ -20,4 +20,4 @@ module CI #:nodoc:
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
|
-
end
|
23
|
+
end
|
data/lib/ci/reporter/rspec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
@@ -97,6 +97,7 @@ module CI
|
|
97
97
|
spec = @suite.testcases.last
|
98
98
|
spec.finish
|
99
99
|
spec.name = "#{spec.name} (PENDING)"
|
100
|
+
spec.skipped = true
|
100
101
|
end
|
101
102
|
|
102
103
|
def start_dump
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
@@ -36,7 +36,7 @@ module CI
|
|
36
36
|
end
|
37
37
|
|
38
38
|
# Basic structure representing the running of a test suite. Used to time tests and store results.
|
39
|
-
class TestSuite < Struct.new(:name, :tests, :time, :failures, :errors, :assertions)
|
39
|
+
class TestSuite < Struct.new(:name, :tests, :time, :failures, :errors, :skipped, :assertions)
|
40
40
|
attr_accessor :testcases
|
41
41
|
attr_accessor :stdout, :stderr
|
42
42
|
def initialize(name)
|
@@ -59,6 +59,7 @@ module CI
|
|
59
59
|
self.time = Time.now - @start
|
60
60
|
self.failures = testcases.inject(0) {|sum,tc| sum += tc.failures.select{|f| f.failure? }.size }
|
61
61
|
self.errors = testcases.inject(0) {|sum,tc| sum += tc.failures.select{|f| f.error? }.size }
|
62
|
+
self.skipped = testcases.inject(0) {|sum,tc| sum += (tc.skipped? ? 1 : 0) }
|
62
63
|
self.stdout = @capture_out.finish if @capture_out
|
63
64
|
self.stderr = @capture_err.finish if @capture_err
|
64
65
|
end
|
@@ -103,6 +104,7 @@ module CI
|
|
103
104
|
# Structure used to represent an individual test case. Used to time the test and store the result.
|
104
105
|
class TestCase < Struct.new(:name, :time, :assertions)
|
105
106
|
attr_accessor :failures
|
107
|
+
attr_accessor :skipped
|
106
108
|
|
107
109
|
def initialize(*args)
|
108
110
|
super
|
@@ -129,19 +131,27 @@ module CI
|
|
129
131
|
!failures.empty? && failures.detect {|f| f.error? }
|
130
132
|
end
|
131
133
|
|
134
|
+
def skipped?
|
135
|
+
return skipped
|
136
|
+
end
|
137
|
+
|
132
138
|
# Writes xml representing the test result to the provided builder.
|
133
139
|
def to_xml(builder)
|
134
140
|
attrs = {}
|
135
141
|
each_pair {|k,v| attrs[k] = builder.trunc!(v.to_s) unless v.nil? || v.to_s.empty?}
|
136
142
|
builder.testcase(attrs) do
|
137
|
-
|
138
|
-
builder.
|
139
|
-
|
140
|
-
|
143
|
+
if skipped
|
144
|
+
builder.skipped
|
145
|
+
else
|
146
|
+
failures.each do |failure|
|
147
|
+
builder.failure(:type => builder.trunc!(failure.name), :message => builder.trunc!(failure.message)) do
|
148
|
+
builder.text!(failure.message + " (#{failure.name})\n")
|
149
|
+
builder.text!(failure.location)
|
150
|
+
end
|
141
151
|
end
|
142
152
|
end
|
143
153
|
end
|
144
154
|
end
|
145
155
|
end
|
146
156
|
end
|
147
|
-
end
|
157
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
@@ -121,4 +121,4 @@ module CI
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
124
|
-
end
|
124
|
+
end
|
data/lib/ci/reporter/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
@@ -54,4 +54,4 @@ describe "Output capture" do
|
|
54
54
|
@suite.stdout.should == "B"
|
55
55
|
@suite.stderr.should == "B"
|
56
56
|
end
|
57
|
-
end
|
57
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
@@ -36,4 +36,4 @@ describe "The ReportManager" do
|
|
36
36
|
File.exist?(filename).should be_true
|
37
37
|
File.open(filename) {|f| f.read.should == "<xml></xml>"}
|
38
38
|
end
|
39
|
-
end
|
39
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
@@ -79,6 +79,7 @@ describe "TestSuite xml" do
|
|
79
79
|
|
80
80
|
@suite.start
|
81
81
|
@suite.testcases << CI::Reporter::TestCase.new("example test")
|
82
|
+
@suite.testcases << CI::Reporter::TestCase.new("skipped test").tap {|tc| tc.skipped = true }
|
82
83
|
@suite.testcases << CI::Reporter::TestCase.new("failure test")
|
83
84
|
@suite.testcases.last.failures << failure
|
84
85
|
@suite.testcases << CI::Reporter::TestCase.new("error test")
|
@@ -94,7 +95,7 @@ describe "TestSuite xml" do
|
|
94
95
|
testsuite.attributes["assertions"].should == "11"
|
95
96
|
|
96
97
|
testcases = testsuite.elements.to_a("testcase")
|
97
|
-
testcases.length.should ==
|
98
|
+
testcases.length.should == 4
|
98
99
|
end
|
99
100
|
|
100
101
|
it "should contain full exception type and message in location element" do
|
@@ -147,4 +148,4 @@ describe "A TestCase" do
|
|
147
148
|
@tc.finish
|
148
149
|
@tc.time.should >= 0
|
149
150
|
end
|
150
|
-
end
|
151
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# (c)
|
1
|
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
|
2
2
|
# See the file LICENSE.txt included with the distribution for
|
3
3
|
# software license details.
|
4
4
|
|
@@ -149,4 +149,4 @@ describe "The TestUnit reporter" do
|
|
149
149
|
@suite.testcases.length.should == 1
|
150
150
|
@suite.testcases.first.name.should == "some unknown test"
|
151
151
|
end
|
152
|
-
end
|
152
|
+
end
|
data/spec/spec_helper.rb
CHANGED
data/stub.rake
CHANGED
data/tasks/ci_reporter.rake
CHANGED
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci_reporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 6
|
8
|
+
- 1
|
9
|
+
version: 1.6.1
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Nick Sieger
|
@@ -9,19 +14,23 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-03-25 00:00:00 -05:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: builder
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 1
|
30
|
+
- 2
|
23
31
|
version: 2.1.2
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
description: CI::Reporter is an add-on to Test::Unit, RSpec and Cucumber that allows you to generate XML reports of your test, spec and/or feature runs. The resulting files can be read by a continuous integration system that understands Ant's JUnit report XML format, thus allowing your CI system to track test/spec successes and failures.
|
26
35
|
email: nick@nicksieger.com
|
27
36
|
executables: []
|
@@ -64,6 +73,8 @@ files:
|
|
64
73
|
- tasks/ci_reporter.rake
|
65
74
|
has_rdoc: true
|
66
75
|
homepage: http://caldersphere.rubyforge.org/ci_reporter
|
76
|
+
licenses: []
|
77
|
+
|
67
78
|
post_install_message:
|
68
79
|
rdoc_options:
|
69
80
|
- --main
|
@@ -74,20 +85,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
85
|
requirements:
|
75
86
|
- - ">="
|
76
87
|
- !ruby/object:Gem::Version
|
88
|
+
segments:
|
89
|
+
- 0
|
77
90
|
version: "0"
|
78
|
-
version:
|
79
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
92
|
requirements:
|
81
93
|
- - ">="
|
82
94
|
- !ruby/object:Gem::Version
|
95
|
+
segments:
|
96
|
+
- 0
|
83
97
|
version: "0"
|
84
|
-
version:
|
85
98
|
requirements: []
|
86
99
|
|
87
100
|
rubyforge_project: caldersphere
|
88
|
-
rubygems_version: 1.3.
|
101
|
+
rubygems_version: 1.3.6
|
89
102
|
signing_key:
|
90
|
-
specification_version:
|
103
|
+
specification_version: 3
|
91
104
|
summary: CI::Reporter allows you to generate reams of XML for use with continuous integration systems.
|
92
105
|
test_files:
|
93
106
|
- spec/ci/reporter/cucumber_spec.rb
|