rspec_junit_formatter 0.4.1 → 0.6.0
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 +1 -1
- 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 +8 -4
- data.tar.gz.sig +2 -2
- metadata +21 -21
- 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: 903f156687c6fff260143332222e9950fca53b5306bcde7cf197c44f3af4acf7
|
4
|
+
data.tar.gz: 1d2ffca113b3cd78b3230d66ed41268609ce38f06e50da6cd196af9073670500
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d32b7a3b5dec828fe29c714755b3698ad8a48b1cfc92185b6f53e5eb4a6ab47adae5cb74743cbc6b5814d0a5d61d15d49b632aadd5afdede74820628796687
|
7
|
+
data.tar.gz: 76537f5a365796f1e062cbfde157f8f48c163b7973ae6a1faae533cbf4684bd3c29cd26d6cb344eac8c46c0ae950f854b48f21bbf2bd28bfbf2ebab6e12b639e
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
��[h��bJ��9��$P�6��-�@V
|
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/unit_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)}"}
|
@@ -68,7 +70,9 @@ private
|
|
68
70
|
output << %{ classname="#{escape(classname_for(example))}"}
|
69
71
|
output << %{ name="#{escape(description_for(example))}"}
|
70
72
|
output << %{ file="#{escape(example_group_file_path_for(example))}"}
|
71
|
-
|
73
|
+
if duration = duration_for(example)
|
74
|
+
output << %{ time="#{escape("%.6f" % duration)}"}
|
75
|
+
end
|
72
76
|
output << %{>}
|
73
77
|
yield if block_given?
|
74
78
|
xml_dump_output(example)
|
@@ -91,7 +95,7 @@ private
|
|
91
95
|
|
92
96
|
# Inversion of character range from https://www.w3.org/TR/xml/#charsets
|
93
97
|
ILLEGAL_REGEXP = Regexp.new(
|
94
|
-
"[^" <<
|
98
|
+
"[^".dup <<
|
95
99
|
"\u{9}" << # => \t
|
96
100
|
"\u{a}" << # => \n
|
97
101
|
"\u{d}" << # => \r
|
@@ -123,7 +127,7 @@ private
|
|
123
127
|
# Discouraged characters from https://www.w3.org/TR/xml/#charsets
|
124
128
|
# Plus special characters with well-known entity replacements
|
125
129
|
DISCOURAGED_REGEXP = Regexp.new(
|
126
|
-
"[" <<
|
130
|
+
"[".dup <<
|
127
131
|
"\u{22}" << # => "
|
128
132
|
"\u{26}" << # => &
|
129
133
|
"\u{27}" << # => '
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
kb�u�(5����\���<F�,���uЯ�vx��}-~rBFl���;k�;P�K1t��{<��4�rZ+۱�H��"r��W�żi��q�ws�[����Z��T�E������D���_
|
2
|
+
O9�&�Eh�R��:V�,����}����B��
|
metadata
CHANGED
@@ -1,34 +1,35 @@
|
|
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.6.0
|
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
|
+
MIIDXDCCAkSgAwIBAgIBATANBgkqhkiG9w0BAQs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HfPCjs1CeU4es9xdQFfhqXAPXG
|
27
|
+
P7mK3+qd5jObjh6l3/rDKrTXNS+P+YO/1frlZ6xPjCA8XgGc4y0rhAjZnVBDV6t1
|
28
|
+
kmdtEmue1s1OxaMakr78XRZDxEuAeLM5fg8MYnlOFygEcAH6lZkTjXavY7s9MXRB
|
29
|
+
AAMioxgB6J5QhXQ42OSWIzwHZIbSv3DV9Lf5sde50HIW5f9u5jn29TUGDhSWYKkh
|
30
|
+
LDvy9dfwMMOdIZi75Q8SBBib84AuwhMHIlUv9FcHhh3dXsDDYkrVrpUAwCsG6yCm
|
30
31
|
-----END CERTIFICATE-----
|
31
|
-
date:
|
32
|
+
date: 2022-09-29 00:00:00.000000000 Z
|
32
33
|
dependencies:
|
33
34
|
- !ruby/object:Gem::Dependency
|
34
35
|
name: rspec-core
|
@@ -143,12 +144,12 @@ files:
|
|
143
144
|
- lib/rspec_junit_formatter.rb
|
144
145
|
- lib/rspec_junit_formatter/rspec2.rb
|
145
146
|
- lib/rspec_junit_formatter/rspec3.rb
|
146
|
-
homepage:
|
147
|
+
homepage: https://github.com/sj26/rspec_junit_formatter
|
147
148
|
licenses:
|
148
149
|
- MIT
|
149
150
|
metadata:
|
150
|
-
changelog_uri: https://github.com/sj26/rspec_junit_formatter/blob/
|
151
|
-
post_install_message:
|
151
|
+
changelog_uri: https://github.com/sj26/rspec_junit_formatter/blob/HEAD/CHANGELOG.md
|
152
|
+
post_install_message:
|
152
153
|
rdoc_options: []
|
153
154
|
require_paths:
|
154
155
|
- lib
|
@@ -156,16 +157,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
157
|
requirements:
|
157
158
|
- - ">="
|
158
159
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.
|
160
|
+
version: 2.3.0
|
160
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
162
|
requirements:
|
162
163
|
- - ">="
|
163
164
|
- !ruby/object:Gem::Version
|
164
165
|
version: 2.0.0
|
165
166
|
requirements: []
|
166
|
-
|
167
|
-
|
168
|
-
signing_key:
|
167
|
+
rubygems_version: 3.3.7
|
168
|
+
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: RSpec JUnit XML formatter
|
171
171
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|