ci_reporter 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yaml +27 -0
- data/.github/workflows/release.yaml +41 -0
- data/History.txt +15 -0
- data/README.md +6 -7
- data/Rakefile +0 -1
- data/ci_reporter.gemspec +1 -0
- data/lib/ci/reporter/monotonic_time.rb +22 -0
- data/lib/ci/reporter/report_manager.rb +2 -2
- data/lib/ci/reporter/test_suite.rb +9 -5
- data/lib/ci/reporter/version.rb +1 -1
- metadata +20 -6
- data/.travis.yml +0 -5
- data/gemfiles/.gitignore +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a528a2fafebcc8be684a8ca7dc12acef432ac82dec567d5b1176bdfdb5377ffb
|
4
|
+
data.tar.gz: 97d80b1b12e409a0d9ad4d5a9592800a30492b41050787c43a16d86128687167
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af641871ec70d11f86d1afa32590d848a8e3118bb5fd494f07005f8f97421242f365c74197e6cee1b606b4c817622539b5b9d4df4e65449c4c8f745d8c49dafc
|
7
|
+
data.tar.gz: e9cbaff5e0ec53a727791a81645282653ac8d29ed68e0970bc454d5c84b05bf170adb4b1ce5f1a8cd2f895b0adfaba9b07ae9a72c34b5115aae12a7189ce8907
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- main
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
name: test
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', head, jruby, jruby-head]
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v3
|
20
|
+
- uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
23
|
+
bundler-cache: true
|
24
|
+
- name: Tests
|
25
|
+
run: bundle exec rake
|
26
|
+
- name: Gem build
|
27
|
+
run: bundle exec rake build
|
@@ -0,0 +1,41 @@
|
|
1
|
+
name: Release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- "v[0-9]+.[0-9]+.[0-9]+"
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
release:
|
10
|
+
name: release
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v3
|
14
|
+
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: '3.2'
|
18
|
+
bundler-cache: true
|
19
|
+
|
20
|
+
- name: Log into Rubygems
|
21
|
+
run: |
|
22
|
+
mkdir -p ~/.local/share/gem
|
23
|
+
echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" > ~/.local/share/gem/credentials
|
24
|
+
chmod 600 ~/.local/share/gem/credentials
|
25
|
+
|
26
|
+
- name: Release
|
27
|
+
run: |
|
28
|
+
set -e
|
29
|
+
PKG="$(echo *.gemspec | sed 's/.gemspec//')"
|
30
|
+
VERSION="${GITHUB_REF#refs/tags/v}"
|
31
|
+
bundle exec rake build
|
32
|
+
GEM="pkg/$PKG-$VERSION.gem"
|
33
|
+
if [ -f "$GEM" ]; then
|
34
|
+
gem push $GEM
|
35
|
+
echo "Release $VERSION done."
|
36
|
+
else
|
37
|
+
echo "Build did not create a $VERSION release gem."
|
38
|
+
echo "Please check the version in the gemspec and try again."
|
39
|
+
cat *.gemspec | grep '\.version'
|
40
|
+
exit 1
|
41
|
+
fi
|
data/History.txt
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
== 2.1.0 (2023/02/09)
|
2
|
+
|
3
|
+
=== Changed
|
4
|
+
|
5
|
+
- Testing on Ruby 2.6 - HEAD, JRuby 9.x latest, JRuby HEAD
|
6
|
+
- CI changed to GitHub Actions
|
7
|
+
- Tracking branch changed to `main`
|
8
|
+
- GH #160: Add monotonic time (Michal Cichra)
|
9
|
+
- GH #148: fix deprecation issues (Akira Matsuda)
|
10
|
+
- GH #149: fix for RSpec 3.1.2 (Akira Matsuda)
|
11
|
+
|
12
|
+
=== Removed
|
13
|
+
|
14
|
+
- Testing on versions of Ruby < 2.6
|
15
|
+
|
1
16
|
== 2.0.0 (2014-07-24)
|
2
17
|
|
3
18
|
=== Changed
|
data/README.md
CHANGED
@@ -5,8 +5,7 @@ system that understands Ant's JUnit report XML format, thus allowing
|
|
5
5
|
your CI system to track test/spec successes and failures.
|
6
6
|
|
7
7
|
[![Gem Version](https://badge.fury.io/rb/ci_reporter.svg)](http://badge.fury.io/rb/ci_reporter)
|
8
|
-
[![Build Status](https://
|
9
|
-
[![Dependency Status](https://gemnasium.com/ci-reporter/ci_reporter.svg)](https://gemnasium.com/ci-reporter/ci_reporter)
|
8
|
+
[![Build Status](https://github.com/ci-reporter/ci_reporter/actions/workflows/ci.yaml/badge.svg)](https://github.com/ci-reporter/ci_reporter/actions/workflows/ci.yaml)
|
10
9
|
[![Code Climate](https://codeclimate.com/github/ci-reporter/ci_reporter.png)](https://codeclimate.com/github/ci-reporter/ci_reporter)
|
11
10
|
|
12
11
|
## Usage
|
@@ -33,7 +32,7 @@ Each supported testing framework is provided by a separate gem:
|
|
33
32
|
### Upgrading from CI::Reporter 1.x
|
34
33
|
|
35
34
|
CI::Reporter 1.x supported all the different test frameworks in a
|
36
|
-
single gem. This was
|
35
|
+
single gem. This was convenient, but caused issues as test frameworks
|
37
36
|
released new, sometimes incompatibile, versions. CI::Reporter 2.x has
|
38
37
|
been split into multiple gems, allowing each gem to specify the test
|
39
38
|
framework versions it supports.
|
@@ -46,7 +45,7 @@ it with one or more of the framework-specific gems above.
|
|
46
45
|
1. Add the "Publish JUnit test result report" post-build step
|
47
46
|
in the job configuration.
|
48
47
|
|
49
|
-
2. Enter "test/reports
|
48
|
+
2. Enter "test/reports/\*.xml,spec/reports/\*.xml" in the "Test report
|
50
49
|
XMLs" field (adjust this to suit which tests you are running)
|
51
50
|
|
52
51
|
Report files are written, by default, to the
|
@@ -69,7 +68,7 @@ will be invoked:
|
|
69
68
|
```ruby
|
70
69
|
if ENV['GENERATE_REPORTS'] == 'true'
|
71
70
|
require 'ci/reporter/rake/rspec'
|
72
|
-
task :
|
71
|
+
task :spec => 'ci:setup:rspec'
|
73
72
|
end
|
74
73
|
```
|
75
74
|
|
@@ -77,7 +76,7 @@ You can either inject this variable in your CI or simply call `rake`
|
|
77
76
|
with the environment variable set:
|
78
77
|
|
79
78
|
```
|
80
|
-
GENERATE_REPORTS=true rake
|
79
|
+
GENERATE_REPORTS=true rake spec
|
81
80
|
```
|
82
81
|
|
83
82
|
### With CI-specific Rake tasks
|
@@ -86,7 +85,7 @@ Instead of modifying your existing Rake tasks, create new ones:
|
|
86
85
|
|
87
86
|
```ruby
|
88
87
|
namespace :ci do
|
89
|
-
task :all => ['ci:setup:rspec', '
|
88
|
+
task :all => ['ci:setup:rspec', 'spec']
|
90
89
|
end
|
91
90
|
```
|
92
91
|
|
data/Rakefile
CHANGED
data/ci_reporter.gemspec
CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.extra_rdoc_files = ["History.txt", "LICENSE.txt", "README.md"]
|
22
22
|
|
23
23
|
spec.add_dependency "builder", ">= 2.1.2"
|
24
|
+
spec.add_dependency "rexml"
|
24
25
|
|
25
26
|
spec.add_development_dependency "rake"
|
26
27
|
spec.add_development_dependency "rdoc", "~> 4.0"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module CI
|
2
|
+
module Reporter
|
3
|
+
module MonotonicTime
|
4
|
+
module_function
|
5
|
+
|
6
|
+
if defined?(Process::CLOCK_MONOTONIC)
|
7
|
+
def time_in_nanoseconds
|
8
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond)
|
9
|
+
end
|
10
|
+
else
|
11
|
+
def time_in_nanoseconds
|
12
|
+
t = Time.now
|
13
|
+
t.to_i * 10 ** 9 + t.nsec
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def time_in_seconds
|
18
|
+
time_in_nanoseconds / 10 ** 9.0
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -31,7 +31,7 @@ module CI #:nodoc:
|
|
31
31
|
# with N < 100000, to prevent endless sidestep loops
|
32
32
|
MAX_SIDESTEPS = 100000
|
33
33
|
MAX_FILENAME_SIZE = 240
|
34
|
-
|
34
|
+
|
35
35
|
def filename_for(suite)
|
36
36
|
basename = "#{@basename}-#{suite.name.gsub(/[^a-zA-Z0-9]+/, '-')}"
|
37
37
|
suffix = "xml"
|
@@ -48,7 +48,7 @@ module CI #:nodoc:
|
|
48
48
|
# if the initial filename is already in use
|
49
49
|
# do sidesteps, beginning with SPEC-MailsController.0.xml
|
50
50
|
i = 0
|
51
|
-
while File.
|
51
|
+
while File.exist?(filename) && i < MAX_SIDESTEPS
|
52
52
|
filename = [basename, i, suffix].join(".")
|
53
53
|
i += 1
|
54
54
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'time'
|
2
2
|
require 'builder'
|
3
3
|
require 'ci/reporter/output_capture'
|
4
|
+
require 'ci/reporter/monotonic_time'
|
4
5
|
|
5
6
|
module CI
|
6
7
|
module Reporter
|
@@ -32,11 +33,14 @@ module CI
|
|
32
33
|
def initialize(name)
|
33
34
|
super(name.to_s) # RSpec passes a "description" object instead of a string
|
34
35
|
@testcases = []
|
36
|
+
@capture_out = nil
|
37
|
+
@capture_err = nil
|
35
38
|
end
|
36
39
|
|
37
40
|
# Starts timing the test suite.
|
38
41
|
def start
|
39
|
-
@
|
42
|
+
@start_time = Time.now
|
43
|
+
@start = MonotonicTime.time_in_seconds
|
40
44
|
unless ENV['CI_CAPTURE'] == "off"
|
41
45
|
@capture_out = OutputCapture.wrap($stdout) {|io| $stdout = io }
|
42
46
|
@capture_err = OutputCapture.wrap($stderr) {|io| $stderr = io }
|
@@ -46,8 +50,8 @@ module CI
|
|
46
50
|
# Finishes timing the test suite.
|
47
51
|
def finish
|
48
52
|
self.tests = testcases.size
|
49
|
-
self.time =
|
50
|
-
self.timestamp = @
|
53
|
+
self.time = MonotonicTime.time_in_seconds - @start
|
54
|
+
self.timestamp = @start_time.iso8601
|
51
55
|
self.failures = testcases.map(&:failure_count).reduce(&:+)
|
52
56
|
self.errors = testcases.map(&:error_count).reduce(&:+)
|
53
57
|
self.skipped = testcases.count(&:skipped?)
|
@@ -91,12 +95,12 @@ module CI
|
|
91
95
|
|
92
96
|
# Starts timing the test.
|
93
97
|
def start
|
94
|
-
@start =
|
98
|
+
@start = MonotonicTime.time_in_seconds
|
95
99
|
end
|
96
100
|
|
97
101
|
# Finishes timing the test.
|
98
102
|
def finish
|
99
|
-
self.time =
|
103
|
+
self.time = MonotonicTime.time_in_seconds - @start
|
100
104
|
end
|
101
105
|
|
102
106
|
# Returns non-nil if the test failed.
|
data/lib/ci/reporter/version.rb
CHANGED
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: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sieger
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|
@@ -25,6 +25,20 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 2.1.2
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rexml
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: rake
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,17 +94,18 @@ extra_rdoc_files:
|
|
80
94
|
- LICENSE.txt
|
81
95
|
- README.md
|
82
96
|
files:
|
97
|
+
- ".github/workflows/ci.yaml"
|
98
|
+
- ".github/workflows/release.yaml"
|
83
99
|
- ".gitignore"
|
84
100
|
- ".rspec"
|
85
|
-
- ".travis.yml"
|
86
101
|
- Gemfile
|
87
102
|
- History.txt
|
88
103
|
- LICENSE.txt
|
89
104
|
- README.md
|
90
105
|
- Rakefile
|
91
106
|
- ci_reporter.gemspec
|
92
|
-
- gemfiles/.gitignore
|
93
107
|
- lib/ci/reporter/core.rb
|
108
|
+
- lib/ci/reporter/monotonic_time.rb
|
94
109
|
- lib/ci/reporter/output_capture.rb
|
95
110
|
- lib/ci/reporter/rake/utils.rb
|
96
111
|
- lib/ci/reporter/report_manager.rb
|
@@ -119,8 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
134
|
- !ruby/object:Gem::Version
|
120
135
|
version: '0'
|
121
136
|
requirements: []
|
122
|
-
|
123
|
-
rubygems_version: 2.2.2
|
137
|
+
rubygems_version: 3.4.1
|
124
138
|
signing_key:
|
125
139
|
specification_version: 4
|
126
140
|
summary: Connects Ruby test frameworks to CI systems via JUnit reports.
|
data/gemfiles/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Gemfile.*.lock
|