ci_reporter 1.9.1 → 1.9.2
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/Gemfile +1 -1
- data/History.txt +6 -0
- data/README.rdoc +23 -1
- data/Rakefile +4 -5
- data/ci_reporter.gemspec +3 -7
- data/lib/ci/reporter/test_suite.rb +4 -2
- data/lib/ci/reporter/version.rb +2 -2
- data/spec/ci/reporter/report_manager_spec.rb +1 -1
- data/spec/ci/reporter/test_suite_spec.rb +1 -0
- metadata +4 -20
data/Gemfile
CHANGED
data/History.txt
CHANGED
data/README.rdoc
CHANGED
|
@@ -8,7 +8,7 @@ CI::Reporter is available as a gem. To install the gem, use the usual gem comman
|
|
|
8
8
|
|
|
9
9
|
== Usage
|
|
10
10
|
|
|
11
|
-
CI::Reporter works best with projects that use a +Rakefile+ along with the standard <code>Rake::TestTask</code> or <code>Spec::Rake::SpecTask/RSpec::Core::RakeTask</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
|
|
11
|
+
CI::Reporter works best with projects that use a +Rakefile+ along with the standard <code>Rake::TestTask</code> or <code>Spec::Rake::SpecTask/RSpec::Core::RakeTask</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 skip to next section.
|
|
12
12
|
|
|
13
13
|
1. To use CI::Reporter, simply add one of the following lines to your Rakefile:
|
|
14
14
|
|
|
@@ -30,6 +30,28 @@ cucumber and spinach.
|
|
|
30
30
|
rake ci:setup:cucumber features
|
|
31
31
|
rake ci:setup:spinach features
|
|
32
32
|
|
|
33
|
+
=== Rails
|
|
34
|
+
|
|
35
|
+
If you use rails-rspec gem all you need to do is to create new rake task lib/tasks/ci_reporter.rake:
|
|
36
|
+
|
|
37
|
+
if ENV['GENERATE_REPORTS'] == 'true'
|
|
38
|
+
require 'ci/reporter/rake/rspec'
|
|
39
|
+
task :spec => 'ci:setup:rspec'
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
And then you can either inject this variable in you CI or simply call rspec passing this as one of the parameters:
|
|
43
|
+
|
|
44
|
+
rspec ... GENERATE_REPORTS=true
|
|
45
|
+
|
|
46
|
+
=== RSpec Formatters
|
|
47
|
+
|
|
48
|
+
CI::Reporter has seperate Rake tasks for each builtin RSpec formatter. Depending upon which formatter you would like, call the following corresponding task.
|
|
49
|
+
|
|
50
|
+
Progress (default) :: ci:setup:rspec
|
|
51
|
+
Base :: ci:setup:rspecbase
|
|
52
|
+
Documentation :: ci:setup:rspecdoc
|
|
53
|
+
|
|
54
|
+
|
|
33
55
|
== Jenkins setup
|
|
34
56
|
|
|
35
57
|
1. Tick the box labelled "Publish JUnit test result report" in the job configuration
|
data/Rakefile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#--
|
|
2
|
-
# Copyright (c) 2006-
|
|
2
|
+
# Copyright (c) 2006-2014 Nick Sieger <nicksieger@gmail.com>
|
|
3
3
|
# See the file LICENSE.txt included with the distribution for
|
|
4
4
|
# software license details.
|
|
5
5
|
#++
|
|
@@ -8,13 +8,13 @@ require 'bundler/setup'
|
|
|
8
8
|
|
|
9
9
|
begin
|
|
10
10
|
require 'hoe'
|
|
11
|
-
Hoe.plugin :
|
|
11
|
+
Hoe.plugin :git
|
|
12
12
|
require File.dirname(__FILE__) + '/lib/ci/reporter/version'
|
|
13
13
|
hoe = Hoe.spec("ci_reporter") do |p|
|
|
14
14
|
p.version = CI::Reporter::VERSION
|
|
15
|
-
p.
|
|
15
|
+
p.group_name = "caldersphere"
|
|
16
16
|
p.readme_file = "README.rdoc"
|
|
17
|
-
p.urls = ["
|
|
17
|
+
p.urls = ["https://github.com/nicksieger/ci_reporter"]
|
|
18
18
|
p.author = "Nick Sieger"
|
|
19
19
|
p.email = "nick@nicksieger.com"
|
|
20
20
|
p.readme_file = 'README.rdoc'
|
|
@@ -38,7 +38,6 @@ begin
|
|
|
38
38
|
task :gemspec do
|
|
39
39
|
File.open("#{hoe.name}.gemspec", "w") {|f| f << hoe.spec.to_ruby }
|
|
40
40
|
end
|
|
41
|
-
task :package => :gemspec
|
|
42
41
|
rescue LoadError
|
|
43
42
|
puts "You really need Hoe installed to be able to package this gem"
|
|
44
43
|
end
|
data/ci_reporter.gemspec
CHANGED
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = "ci_reporter"
|
|
5
|
-
s.version = "1.9.
|
|
5
|
+
s.version = "1.9.2"
|
|
6
6
|
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
8
8
|
s.authors = ["Nick Sieger"]
|
|
9
|
-
s.date = "
|
|
9
|
+
s.date = "2014-04-06"
|
|
10
10
|
s.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."
|
|
11
11
|
s.email = "nick@nicksieger.com"
|
|
12
12
|
s.extra_rdoc_files = ["History.txt", "LICENSE.txt", "Manifest.txt", "README.rdoc"]
|
|
13
13
|
s.files = [".gemtest", ".hoerc", ".rspec", ".travis.before_install.sh", ".travis.yml", "Gemfile", "History.txt", "LICENSE.txt", "Manifest.txt", "README.rdoc", "Rakefile", "acceptance/cucumber/cucumber_example.feature", "acceptance/cucumber/step_definitions/development_steps.rb", "acceptance/minitest_example_test.rb", "acceptance/rspec_example_spec.rb", "acceptance/spinach/features/spinach_example.feature", "acceptance/spinach/features/steps/example_spinach_feature.rb", "acceptance/test_unit_example_test.rb", "acceptance/verification_spec.rb", "ci_reporter.gemspec", "lib/ci/reporter/core.rb", "lib/ci/reporter/cucumber.rb", "lib/ci/reporter/minitest.rb", "lib/ci/reporter/rake/cucumber.rb", "lib/ci/reporter/rake/cucumber_loader.rb", "lib/ci/reporter/rake/minitest.rb", "lib/ci/reporter/rake/minitest_loader.rb", "lib/ci/reporter/rake/rspec.rb", "lib/ci/reporter/rake/rspec_loader.rb", "lib/ci/reporter/rake/spinach.rb", "lib/ci/reporter/rake/spinach_loader.rb", "lib/ci/reporter/rake/test_unit.rb", "lib/ci/reporter/rake/test_unit_loader.rb", "lib/ci/reporter/rake/utils.rb", "lib/ci/reporter/report_manager.rb", "lib/ci/reporter/rspec.rb", "lib/ci/reporter/spinach.rb", "lib/ci/reporter/test_suite.rb", "lib/ci/reporter/test_unit.rb", "lib/ci/reporter/version.rb", "spec/ci/reporter/cucumber_spec.rb", "spec/ci/reporter/output_capture_spec.rb", "spec/ci/reporter/rake/rake_tasks_spec.rb", "spec/ci/reporter/report_manager_spec.rb", "spec/ci/reporter/rspec_spec.rb", "spec/ci/reporter/test_suite_spec.rb", "spec/ci/reporter/test_unit_spec.rb", "spec/spec_helper.rb", "stub.rake", "tasks/ci_reporter.rake"]
|
|
14
|
-
s.homepage = "
|
|
14
|
+
s.homepage = "https://github.com/nicksieger/ci_reporter"
|
|
15
15
|
s.licenses = ["MIT"]
|
|
16
16
|
s.rdoc_options = ["--main", "README.rdoc", "-SHN", "-f", "darkfish"]
|
|
17
17
|
s.require_paths = ["lib"]
|
|
18
|
-
s.rubyforge_project = "caldersphere"
|
|
19
18
|
s.rubygems_version = "1.8.23"
|
|
20
19
|
s.summary = "CI::Reporter allows you to generate reams of XML for use with continuous integration systems."
|
|
21
20
|
s.test_files = ["spec/ci/reporter/cucumber_spec.rb", "spec/ci/reporter/output_capture_spec.rb", "spec/ci/reporter/rake/rake_tasks_spec.rb", "spec/ci/reporter/report_manager_spec.rb", "spec/ci/reporter/rspec_spec.rb", "spec/ci/reporter/test_suite_spec.rb", "spec/ci/reporter/test_unit_spec.rb"]
|
|
@@ -25,7 +24,6 @@ Gem::Specification.new do |s|
|
|
|
25
24
|
|
|
26
25
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
27
26
|
s.add_runtime_dependency(%q<builder>, [">= 2.1.2"])
|
|
28
|
-
s.add_development_dependency(%q<rubyforge>, [">= 2.0.4"])
|
|
29
27
|
s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
|
|
30
28
|
s.add_development_dependency(%q<hoe-git>, ["~> 1.5.0"])
|
|
31
29
|
s.add_development_dependency(%q<cucumber>, [">= 1.3.3"])
|
|
@@ -36,7 +34,6 @@ Gem::Specification.new do |s|
|
|
|
36
34
|
s.add_development_dependency(%q<hoe>, ["~> 3.7"])
|
|
37
35
|
else
|
|
38
36
|
s.add_dependency(%q<builder>, [">= 2.1.2"])
|
|
39
|
-
s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
|
|
40
37
|
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
|
41
38
|
s.add_dependency(%q<hoe-git>, ["~> 1.5.0"])
|
|
42
39
|
s.add_dependency(%q<cucumber>, [">= 1.3.3"])
|
|
@@ -48,7 +45,6 @@ Gem::Specification.new do |s|
|
|
|
48
45
|
end
|
|
49
46
|
else
|
|
50
47
|
s.add_dependency(%q<builder>, [">= 2.1.2"])
|
|
51
|
-
s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
|
|
52
48
|
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
|
53
49
|
s.add_dependency(%q<hoe-git>, ["~> 1.5.0"])
|
|
54
50
|
s.add_dependency(%q<cucumber>, [">= 1.3.3"])
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
# Copyright (c) 2006-2012 Nick Sieger <nicksieger@gmail.com>
|
|
1
|
+
# Copyright (c) 2006-2012, 2014 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 'delegate'
|
|
6
6
|
require 'stringio'
|
|
7
|
+
require 'time'
|
|
7
8
|
|
|
8
9
|
module CI
|
|
9
10
|
module Reporter
|
|
@@ -51,7 +52,7 @@ module CI
|
|
|
51
52
|
end
|
|
52
53
|
|
|
53
54
|
# Basic structure representing the running of a test suite. Used to time tests and store results.
|
|
54
|
-
class TestSuite < Struct.new(:name, :tests, :time, :failures, :errors, :skipped, :assertions)
|
|
55
|
+
class TestSuite < Struct.new(:name, :tests, :time, :failures, :errors, :skipped, :assertions, :timestamp)
|
|
55
56
|
attr_accessor :testcases
|
|
56
57
|
attr_accessor :stdout, :stderr
|
|
57
58
|
def initialize(name)
|
|
@@ -72,6 +73,7 @@ module CI
|
|
|
72
73
|
def finish
|
|
73
74
|
self.tests = testcases.size
|
|
74
75
|
self.time = Time.now - @start
|
|
76
|
+
self.timestamp = @start.iso8601
|
|
75
77
|
self.failures = testcases.inject(0) {|sum,tc| sum += tc.failures.select{|f| f.failure? }.size }
|
|
76
78
|
self.errors = testcases.inject(0) {|sum,tc| sum += tc.failures.select{|f| f.error? }.size }
|
|
77
79
|
self.skipped = testcases.inject(0) {|sum,tc| sum += (tc.skipped? ? 1 : 0) }
|
data/lib/ci/reporter/version.rb
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#--
|
|
2
|
-
# Copyright (c) 2006-
|
|
2
|
+
# Copyright (c) 2006-2014 Nick Sieger <nicksieger@gmail.com>
|
|
3
3
|
# See the file LICENSE.txt included with the distribution for
|
|
4
4
|
# software license details.
|
|
5
5
|
#++
|
|
6
6
|
|
|
7
7
|
module CI
|
|
8
8
|
module Reporter
|
|
9
|
-
VERSION = "1.9.
|
|
9
|
+
VERSION = "1.9.2"
|
|
10
10
|
end
|
|
11
11
|
end
|
|
@@ -102,6 +102,7 @@ describe "TestSuite xml" do
|
|
|
102
102
|
testsuite = testsuite.first
|
|
103
103
|
testsuite.attributes["name"].should == "example suite"
|
|
104
104
|
testsuite.attributes["assertions"].should == "11"
|
|
105
|
+
testsuite.attributes["timestamp"].should match(/(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})[+-](\d{2})\:(\d{2})/)
|
|
105
106
|
|
|
106
107
|
testcases = testsuite.elements.to_a("testcase")
|
|
107
108
|
testcases.length.should == 4
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ci_reporter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2014-04-06 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: builder
|
|
@@ -27,22 +27,6 @@ dependencies:
|
|
|
27
27
|
- - ! '>='
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
29
|
version: 2.1.2
|
|
30
|
-
- !ruby/object:Gem::Dependency
|
|
31
|
-
name: rubyforge
|
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
none: false
|
|
34
|
-
requirements:
|
|
35
|
-
- - ! '>='
|
|
36
|
-
- !ruby/object:Gem::Version
|
|
37
|
-
version: 2.0.4
|
|
38
|
-
type: :development
|
|
39
|
-
prerelease: false
|
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
-
none: false
|
|
42
|
-
requirements:
|
|
43
|
-
- - ! '>='
|
|
44
|
-
- !ruby/object:Gem::Version
|
|
45
|
-
version: 2.0.4
|
|
46
30
|
- !ruby/object:Gem::Dependency
|
|
47
31
|
name: rdoc
|
|
48
32
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -235,7 +219,7 @@ files:
|
|
|
235
219
|
- spec/spec_helper.rb
|
|
236
220
|
- stub.rake
|
|
237
221
|
- tasks/ci_reporter.rake
|
|
238
|
-
homepage:
|
|
222
|
+
homepage: https://github.com/nicksieger/ci_reporter
|
|
239
223
|
licenses:
|
|
240
224
|
- MIT
|
|
241
225
|
post_install_message:
|
|
@@ -255,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
255
239
|
version: '0'
|
|
256
240
|
segments:
|
|
257
241
|
- 0
|
|
258
|
-
hash:
|
|
242
|
+
hash: 3520831891635104041
|
|
259
243
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
244
|
none: false
|
|
261
245
|
requirements:
|