rspec_junit_formatter 0.4.1 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/LICENSE +1 -1
- data/README.md +5 -6
- data/lib/rspec_junit_formatter/rspec2.rb +6 -0
- data/lib/rspec_junit_formatter/rspec3.rb +11 -0
- data/lib/rspec_junit_formatter.rb +5 -3
- data.tar.gz.sig +0 -0
- metadata +17 -18
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2262f9dd5b2368ab268f8f251b528b7ae60816accb3192bd1dd0b250ef097bc
|
4
|
+
data.tar.gz: dd120f276314e33ec44ad6982b3ef9371519a38d770a3de33800ef8015067275
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6733eaf055a5019767ea3586e426088ebe1eb3f57d5dcb2e6dba9d51bfa1543b36d410f5ac19142c512a4096976a8a02a23d7d55160f8028cbe9807d98c344f
|
7
|
+
data.tar.gz: 9bd13f22884872acb215295c6b45b0a332c3c510918be068b6e7619479db8ca9d991df124ab47a535c164fac42e424c8b6152158acab1839c07bf7de95eaa43b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
# RSpec JUnit Formatter
|
2
2
|
|
3
|
-
[![Build results](
|
3
|
+
[![Build results](https://github.com/sj26/rspec_junit_formatter/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/sj26/rspec_junit_formatter/actions/workflows/ci.yml?branch=main)
|
4
4
|
[![Gem version](http://img.shields.io/gem/v/rspec_junit_formatter.svg)](https://rubygems.org/gems/rspec_junit_formatter)
|
5
5
|
|
6
|
-
[RSpec][rspec] 2 & 3 results that your CI can read. [Jenkins][jenkins-junit], [Buildkite][buildkite-junit], [CircleCI][circleci-junit], and probably more, too.
|
6
|
+
[RSpec][rspec] 2 & 3 results that your CI can read. [Jenkins][jenkins-junit], [Buildkite][buildkite-junit], [CircleCI][circleci-junit], [Gitlab][gitlab-junit], and probably more, too.
|
7
7
|
|
8
8
|
[rspec]: http://rspec.info/
|
9
9
|
[jenkins-junit]: https://jenkins.io/doc/pipeline/steps/junit/
|
10
10
|
[buildkite-junit]: https://github.com/buildkite/rspec-junit-example
|
11
11
|
[circleci-junit]: https://circleci.com/docs/2.0/collect-test-data/
|
12
|
+
[gitlab-junit]: https://docs.gitlab.com/ee/ci/junit_test_reports.html#ruby-example
|
12
13
|
|
13
14
|
## Usage
|
14
15
|
|
@@ -89,16 +90,14 @@ RSpec.configure do |config|
|
|
89
90
|
end
|
90
91
|
```
|
91
92
|
|
93
|
+
Note that this example captures all output from every example all the time, potentially interfering with local debugging. You might like to restrict this to only on CI, or by using [rspec filters](https://relishapp.com/rspec/rspec-core/docs/hooks/filters).
|
94
|
+
|
92
95
|
## Caveats
|
93
96
|
|
94
97
|
* XML can only represent a [limited subset of characters][xml-charsets] which excludes null bytes and most control characters. This gem will use character entities where possible and fall back to replacing invalid characters with Ruby-like escape codes otherwise. For example, the null byte becomes `\0`.
|
95
98
|
|
96
99
|
[xml-charsets]: https://www.w3.org/TR/xml/#charsets
|
97
100
|
|
98
|
-
## Roadmap
|
99
|
-
|
100
|
-
* It would be nice to split things up into individual test suites, although would this correspond to example groups? The subject? The spec file? Not sure yet.
|
101
|
-
|
102
101
|
## Development
|
103
102
|
|
104
103
|
Run the specs with `bundle exec rake`, which uses [Appraisal][appraisal] to run the specs against all supported versions of rspec.
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class RSpecJUnitFormatter < RSpec::Core::Formatters::BaseFormatter
|
2
4
|
attr_reader :started
|
3
5
|
|
@@ -62,6 +64,10 @@ private
|
|
62
64
|
"#{message}\n#{backtrace.join("\n")}"
|
63
65
|
end
|
64
66
|
|
67
|
+
def error_count
|
68
|
+
0
|
69
|
+
end
|
70
|
+
|
65
71
|
def find_shared_group(example)
|
66
72
|
group_and_parent_groups(example).find { |group| group.metadata[:shared_group_name] }
|
67
73
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class RSpecJUnitFormatter < RSpec::Core::Formatters::BaseFormatter
|
2
4
|
RSpec::Core::Formatters.register self,
|
3
5
|
:start,
|
@@ -43,6 +45,15 @@ private
|
|
43
45
|
@examples_notification.notifications
|
44
46
|
end
|
45
47
|
|
48
|
+
def error_count
|
49
|
+
# Introduced in rspec 3.6
|
50
|
+
if @summary_notification.respond_to?(:errors_outside_of_examples_count)
|
51
|
+
@summary_notification.errors_outside_of_examples_count
|
52
|
+
else
|
53
|
+
0
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
46
57
|
def result_of(notification)
|
47
58
|
notification.example.execution_result.status
|
48
59
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "socket"
|
2
4
|
require "time"
|
3
5
|
|
@@ -18,7 +20,7 @@ private
|
|
18
20
|
output << %{ tests="#{example_count}"}
|
19
21
|
output << %{ skipped="#{pending_count}"}
|
20
22
|
output << %{ failures="#{failure_count}"}
|
21
|
-
output << %{ errors="
|
23
|
+
output << %{ errors="#{error_count}"}
|
22
24
|
output << %{ time="#{escape("%.6f" % duration)}"}
|
23
25
|
output << %{ timestamp="#{escape(started.iso8601)}"}
|
24
26
|
output << %{ hostname="#{escape(Socket.gethostname)}"}
|
@@ -91,7 +93,7 @@ private
|
|
91
93
|
|
92
94
|
# Inversion of character range from https://www.w3.org/TR/xml/#charsets
|
93
95
|
ILLEGAL_REGEXP = Regexp.new(
|
94
|
-
"[^" <<
|
96
|
+
"[^".dup <<
|
95
97
|
"\u{9}" << # => \t
|
96
98
|
"\u{a}" << # => \n
|
97
99
|
"\u{d}" << # => \r
|
@@ -123,7 +125,7 @@ private
|
|
123
125
|
# Discouraged characters from https://www.w3.org/TR/xml/#charsets
|
124
126
|
# Plus special characters with well-known entity replacements
|
125
127
|
DISCOURAGED_REGEXP = Regexp.new(
|
126
|
-
"[" <<
|
128
|
+
"[".dup <<
|
127
129
|
"\u{22}" << # => "
|
128
130
|
"\u{26}" << # => &
|
129
131
|
"\u{27}" << # => '
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_junit_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Cochran
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MIIDKDCCAhCgAwIBAgIBCDANBgkqhkiG9w0BAQsFADA6MQ0wCwYDVQQDDARzajI2
|
14
|
+
MRQwEgYKCZImiZPyLGQBGRYEc2oyNjETMBEGCgmSJomT8ixkARkWA2NvbTAeFw0y
|
15
|
+
MTA0MjcwMzIxMjZaFw0yMjA0MjcwMzIxMjZaMDoxDTALBgNVBAMMBHNqMjYxFDAS
|
16
16
|
BgoJkiaJk/IsZAEZFgRzajI2MRMwEQYKCZImiZPyLGQBGRYDY29tMIIBIjANBgkq
|
17
17
|
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr60Eo/ttCk8GMTMFiPr3GoYMIMFvLak
|
18
18
|
xSmTk9YGCB6UiEePB4THSSA5w6IPyeaCF/nWkDp3/BAam0eZMWG1IzYQB23TqIM0
|
@@ -21,14 +21,14 @@ cert_chain:
|
|
21
21
|
4O/FL2ChjL2CPCpLZW55ShYyrzphWJwLOJe+FJ/ZBl6YXwrzQM9HKnt4titSNvyU
|
22
22
|
KzE3L63A3PZvExzLrN9u09kuWLLJfXB2sGOlw3n9t72rJiuBr3/OQQIDAQABozkw
|
23
23
|
NzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU99dfRjEKFyczTeIz
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
m3ZsDWrNC80wDQYJKoZIhvcNAQELBQADggEBAInkmTwBeGEJ7Xu9jjZIuFaE197m
|
25
|
+
YfvrzVoE6Q1DlWXpgyhhxbPIKg2acvM/Z18A7kQrF7paYl64Ti84dC64seOFIBNx
|
26
|
+
Qj/lxzPHMBoAYqeXYJhnYIXnvGCZ4Fkic5Bhs+VdcDP/uwYp3adqy+4bT/XDFZQg
|
27
|
+
tSjrAOTg3wck5aI+Tz90ONQJ83bnCRr1UPQ0T3PbWMjnNsEa9CAxUB845Sg+9yUz
|
28
|
+
Tvf+pbX8JT9rawFDogxPhL7eRAbjg4MH9amp5l8HTVCAsW8vqv7wM4rtMNAaXmik
|
29
|
+
LJghfDEf70fTtbs4Zv57pPhn1b7wBNf8fh+TZOlYAA6dFtQXoCwfE6bWgQU=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date:
|
31
|
+
date: 2022-01-06 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rspec-core
|
@@ -143,12 +143,12 @@ files:
|
|
143
143
|
- lib/rspec_junit_formatter.rb
|
144
144
|
- lib/rspec_junit_formatter/rspec2.rb
|
145
145
|
- lib/rspec_junit_formatter/rspec3.rb
|
146
|
-
homepage:
|
146
|
+
homepage: https://github.com/sj26/rspec_junit_formatter
|
147
147
|
licenses:
|
148
148
|
- MIT
|
149
149
|
metadata:
|
150
|
-
changelog_uri: https://github.com/sj26/rspec_junit_formatter/blob/
|
151
|
-
post_install_message:
|
150
|
+
changelog_uri: https://github.com/sj26/rspec_junit_formatter/blob/HEAD/CHANGELOG.md
|
151
|
+
post_install_message:
|
152
152
|
rdoc_options: []
|
153
153
|
require_paths:
|
154
154
|
- lib
|
@@ -163,9 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: 2.0.0
|
165
165
|
requirements: []
|
166
|
-
|
167
|
-
|
168
|
-
signing_key:
|
166
|
+
rubygems_version: 3.2.26
|
167
|
+
signing_key:
|
169
168
|
specification_version: 4
|
170
169
|
summary: RSpec JUnit XML formatter
|
171
170
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|