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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a35b79c4d14c6ff0380efafa05837e554c5e6c0e20d59179c9b75357e0aded03
4
- data.tar.gz: cb519dfcac329b330f98d7306364990f4f1c11dc2cb63ced83cb979a42b4f30a
3
+ metadata.gz: 903f156687c6fff260143332222e9950fca53b5306bcde7cf197c44f3af4acf7
4
+ data.tar.gz: 1d2ffca113b3cd78b3230d66ed41268609ce38f06e50da6cd196af9073670500
5
5
  SHA512:
6
- metadata.gz: 905cf4462c5bfaecae9d767e637cb517668b942c07e984713cf3538126406f9cf791c5f666931c51209399cc1c65b47e16aa59a9e645d47870df4eaa9f35f347
7
- data.tar.gz: d27fa3c3802d698da97bf45f38dd14061700cb92a0e99542d79f93fea918613354094735487a6408deceae1adb5cce1286662a8f62e1fa8c1149b6f49d78113c
6
+ metadata.gz: f8d32b7a3b5dec828fe29c714755b3698ad8a48b1cfc92185b6f53e5eb4a6ab47adae5cb74743cbc6b5814d0a5d61d15d49b632aadd5afdede74820628796687
7
+ data.tar.gz: 76537f5a365796f1e062cbfde157f8f48c163b7973ae6a1faae533cbf4684bd3c29cd26d6cb344eac8c46c0ae950f854b48f21bbf2bd28bfbf2ebab6e12b639e
checksums.yaml.gz.sig CHANGED
@@ -1 +1 @@
1
- (����3�E��2�M�;8��K`�8"}Z��� /�3�ft��K��Pa ��:n�&�Sc��9�Z��;:o�zЛ��|W�4�+"ޟ]��E��I�i\U�3�S4�1%nR�n�>t��{z�9�4�=�QDXN���M�+C$�IJ/���?=� ���y.�`E�t*�I�<� �9kG�_J�q���=�z����#�v)=R�6�ۺ�Z�\�OKe���h����.��y�
1
+ ��[h��bJ��9��$P�6��-�@V
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2018 Samuel Cochran
1
+ Copyright (c) 2011-2022 Samuel Cochran
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # RSpec JUnit Formatter
2
2
 
3
- [![Build results](http://img.shields.io/travis/sj26/rspec_junit_formatter/master.svg)](https://travis-ci.org/sj26/rspec_junit_formatter)
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="0"}
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
- output << %{ time="#{escape("%.6f" % duration_for(example))}"}
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
- R�����%3��i]��^���./J3h�����zJ#��� p�F�5
2
- �61D(�f4��o )j�=P�0�(J�;e'����k̰cԒR��޾�n3�� iP2�+Œ�n�k]��z��w�M*{BBq����u94e]�ăf�6��ۣJ�2�_��^�|-�A��I,[��j�Aq��oŬk �0K��C'@�Xb*�jC��R��Vo3��4�0r"c"K�ӅT���F6�������Y��>�k01|B
1
+ kb�u�(5����\���<F�,���uЯ�vx��}-~rBFl���;k�;P�K1t��{<��4�rZ+۱�H��"r��W�żi��q�ws[����Z��TE������ 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.1
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: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
25
- lA209JIjUlDyr9ptCRadihyfF2l9/hb+hLemiPEYppzG6vEK1TIyzbAR36yOJ8CX
26
- 4vPkCXLuwHhs6UIRbwN+IEy41nsIlBxmjLYei8h3t/G2Vm2oOaLdbjDXS+Srl9U8
27
- shsE8ft81PxSQfzEL7Mr9cC9XvWbHW+SyTpfGm8rAtaqZkNeke4U8a0di4oz2EfA
28
- P4lSfmXxsd1C71ckIp0cyXkPhyTtpyS/5hq9HhuUNzEHkSDe36/Rd1xYKV5JxMC2
29
- YAttWFUs06lor2q1wwncPaMtUtbWwW35+1IV6xhs2rFY6DD/I6ZkK3GnHdY=
22
+ KzE3L63A3PZvExzLrN9u09kuWLLJfXB2sGOlw3n9t72rJiuBr3/OQQIDAQABo20w
23
+ azAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU99dfRjEKFyczTeIz
24
+ m3ZsDWrNC80wGAYDVR0RBBEwD4ENc2oyNkBzajI2LmNvbTAYBgNVHRIEETAPgQ1z
25
+ ajI2QHNqMjYuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQCsa7k3TABBcyXotr3yCq6f
26
+ xsgbMG9FR71c4wRgVNQi9O3jN64fQBbxo//BQlHfPCjs1CeU4es9xdQFfhqXAPXG
27
+ P7mK3+qd5jObjh6l3/rDKrTXNS+P+YO/1frlZ6xPjCA8XgGc4y0rhAjZnVBDV6t1
28
+ kmdtEmue1s1OxaMakr78XRZDxEuAeLM5fg8MYnlOFygEcAH6lZkTjXavY7s9MXRB
29
+ AAMioxgB6J5QhXQ42OSWIzwHZIbSv3DV9Lf5sde50HIW5f9u5jn29TUGDhSWYKkh
30
+ LDvy9dfwMMOdIZi75Q8SBBib84AuwhMHIlUv9FcHhh3dXsDDYkrVrpUAwCsG6yCm
30
31
  -----END CERTIFICATE-----
31
- date: 2018-05-30 00:00:00.000000000 Z
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: http://github.com/sj26/rspec_junit_formatter
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/master/CHANGELOG.md
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.0.0
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
- rubyforge_project:
167
- rubygems_version: 2.7.7
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