minitest-reporters 1.6.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +21 -5
- data/.yardopts +1 -2
- data/CHANGELOG.md +10 -1
- data/README.md +13 -13
- data/lib/minitest/reporters/junit_reporter.rb +23 -25
- data/lib/minitest/reporters/progress_reporter.rb +1 -1
- data/lib/minitest/reporters/spec_reporter.rb +6 -3
- data/lib/minitest/reporters/version.rb +1 -1
- data/minitest-reporters.gemspec +1 -2
- data/test/integration/reporters/junit_reporter_test.rb +16 -0
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de01e0afb6f385fb1d12dcf414a2f5f2c5b87363bb6300ae35985c8bc2354638
|
4
|
+
data.tar.gz: 3def5f8c01897b2e39395479f9599dcb6b837366512a8486ad9d7c19a6be5aab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db577d5beacf367f1ed9e61306b927039fe3f2c0ae7c5549094696a0ae457e39c43fc07ab1fc880caf051555e650a57d2a23d051b1e98e8e1db0e5a34609ad00
|
7
|
+
data.tar.gz: 8b4cf058bf3d813fa63fa71005f7eca6a5516a1c317b7bb8ca911f543c09fa8d1295f4079319ae3d19835a73b5a8a77ae619b934a13da28466efd5018160dad0
|
data/.github/workflows/ci.yml
CHANGED
@@ -5,12 +5,12 @@ on: [push, pull_request]
|
|
5
5
|
jobs:
|
6
6
|
test:
|
7
7
|
runs-on: ubuntu-latest
|
8
|
-
|
9
8
|
strategy:
|
10
9
|
fail-fast: false
|
11
10
|
matrix:
|
12
11
|
ruby-version:
|
13
12
|
- head
|
13
|
+
- '3.2'
|
14
14
|
- '3.1'
|
15
15
|
- '3.0'
|
16
16
|
- '2.7'
|
@@ -18,14 +18,30 @@ jobs:
|
|
18
18
|
- '2.5'
|
19
19
|
- '2.4'
|
20
20
|
- '2.3'
|
21
|
-
- '2.2'
|
22
|
-
- '2.1'
|
23
|
-
- '2.0'
|
24
21
|
- jruby-head
|
25
22
|
- jruby-9.3
|
26
23
|
- jruby-9.2
|
27
24
|
steps:
|
28
|
-
- uses: actions/checkout@
|
25
|
+
- uses: actions/checkout@v3
|
26
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
27
|
+
uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby-version }}
|
30
|
+
bundler-cache: true # 'bundle install' and cache
|
31
|
+
- name: Run tests
|
32
|
+
run: bundle exec rake
|
33
|
+
|
34
|
+
legacy-test:
|
35
|
+
runs-on: ubuntu-20.04
|
36
|
+
strategy:
|
37
|
+
fail-fast: false
|
38
|
+
matrix:
|
39
|
+
ruby-version:
|
40
|
+
- '2.2'
|
41
|
+
- '2.1'
|
42
|
+
- '2.0'
|
43
|
+
steps:
|
44
|
+
- uses: actions/checkout@v3
|
29
45
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
30
46
|
uses: ruby/setup-ruby@v1
|
31
47
|
with:
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,13 @@
|
|
1
|
-
### [dev](https://github.com/
|
1
|
+
### [dev](https://github.com/minitest-reporters/minitest-reporters/compare/v1.7.0...master)
|
2
|
+
|
3
|
+
### [1.7.0](https://github.com/minitest-reporters/minitest-reporters/compare/v1.6.1...v1.7.0)
|
4
|
+
|
5
|
+
* Minor documentation improvements [#343](https://github.com/minitest-reporters/minitest-reporters/pull/343)
|
6
|
+
* Fixed homepage link in gemspec [#333](https://github.com/minitest-reporters/minitest-reporters/pull/333) contributed by [andyw8](https://github.com/andyw8)
|
7
|
+
* Added Ruby 3.2 to the CI matrix [#335](https://github.com/minitest-reporters/minitest-reporters/pull/335) contributed by [petergoldstein](https://github.com/petergoldstein)
|
8
|
+
* Updated `JUnitReporter` to output a failure screenshot path when included in the minitest result [#346](https://github.com/minitest-reporters/minitest-reporters/pull/346) contributed by [matteeyah](https://github.com/matteeyah)
|
9
|
+
* Fixed backwards fraction in `ProgressReporter` default format [#348](https://github.com/minitest-reporters/minitest-reporters/pull/348) contributed by [notEthan](https://github.com/notEthan)
|
10
|
+
* Added option `suppress_inline_failure_output` to `SpecReporter` to provide an explicit switch, separate from `print_failure_summary`, for suppressing inline failure messages. Until this change, the `print_failure_summary` would do both: print a failure/error summary after all tests run and suppress the inline failure messages. With this change `print_failure_summary` will just add a summary at the end of a test run, and it will no longer suppress the inline failure messages. [#352](https://github.com/minitest-reporters/minitest-reporters/pull/352) contributed by [rthbound](https://github.com/rthbound)
|
2
11
|
|
3
12
|
### [1.6.1](https://github.com/kern/minitest-reporters/compare/v1.6.0...v1.6.1)
|
4
13
|
|
data/README.md
CHANGED
@@ -46,11 +46,11 @@ export MINITEST_REPORTER=JUnitReporter
|
|
46
46
|
Detection of those systems is based on presence of certain ENV variables and are evaluated in the following order:
|
47
47
|
|
48
48
|
```
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
MINITEST_REPORTER => use reporter indicated in env variable
|
50
|
+
TM_PID => use RubyMateReporter
|
51
|
+
RM_INFO => use RubyMineReporter
|
52
|
+
TEAMCITY_VERSION => use RubyMineReporter
|
53
|
+
VIM => disable all Reporters
|
54
54
|
```
|
55
55
|
|
56
56
|
The following reporters are provided:
|
@@ -77,15 +77,15 @@ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => tru
|
|
77
77
|
|
78
78
|
**Default Reporter**
|
79
79
|
|
80
|
-
![Default Reporter](
|
80
|
+
![Default Reporter](https://raw.githubusercontent.com/minitest-reporters/minitest-reporters/master/assets/default-reporter.png)
|
81
81
|
|
82
82
|
**Spec Reporter**
|
83
83
|
|
84
|
-
![Spec Reporter](
|
84
|
+
![Spec Reporter](https://raw.githubusercontent.com/minitest-reporters/minitest-reporters/master/assets/spec-reporter.png)
|
85
85
|
|
86
86
|
**Progress Reporter**
|
87
87
|
|
88
|
-
![Progress Reporter](
|
88
|
+
![Progress Reporter](https://raw.githubusercontent.com/minitest-reporters/minitest-reporters/master/assets/progress-reporter.png)
|
89
89
|
|
90
90
|
## Caveats ##
|
91
91
|
|
@@ -104,11 +104,11 @@ happening if you see overly long or otherwise unexpected backtraces.)
|
|
104
104
|
To avoid that, you must manually tell minitest-reporters which filter to use. In Rails,
|
105
105
|
do this in `test_helper.rb`:
|
106
106
|
```ruby
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
107
|
+
Minitest::Reporters.use!(
|
108
|
+
Minitest::Reporters::DefaultReporter.new,
|
109
|
+
ENV,
|
110
|
+
Minitest.backtrace_filter
|
111
|
+
)
|
112
112
|
```
|
113
113
|
The third parameter to `.use!`, in this case `Minitest.backtrace_filter`, should be a
|
114
114
|
filter object. In the above example, you're telling minitest-reporters to use the filter
|
@@ -86,31 +86,23 @@ module Minitest
|
|
86
86
|
suite_result = analyze_suite(tests)
|
87
87
|
file_path = get_relative_path(tests.first)
|
88
88
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
:errors => suite_result[:error_count], :tests => suite_result[:test_count],
|
107
|
-
:assertions => suite_result[:assertion_count], :time => suite_result[:time]) do
|
108
|
-
tests.each do |test|
|
109
|
-
lineno = get_source_location(test).last
|
110
|
-
xml.testcase(:name => test.name, :lineno => lineno, :classname => suite, :assertions => test.assertions,
|
111
|
-
:time => test.time, :file => file_path) do
|
112
|
-
xml << xml_message_for(test) unless test.passed?
|
113
|
-
end
|
89
|
+
testsuite_attributes = {
|
90
|
+
:name => suite, :filepath => file_path, :skipped => suite_result[:skip_count],
|
91
|
+
:failures => suite_result[:fail_count], :errors => suite_result[:error_count],
|
92
|
+
:tests => suite_result[:test_count], :assertions => suite_result[:assertion_count],
|
93
|
+
:time => suite_result[:time]
|
94
|
+
}
|
95
|
+
testsuite_attributes[:timestamp] = suite_result[:timestamp] if @timestamp_report
|
96
|
+
|
97
|
+
xml.testsuite(testsuite_attributes) do
|
98
|
+
tests.each do |test|
|
99
|
+
lineno = get_source_location(test).last
|
100
|
+
xml.testcase(
|
101
|
+
:name => test.name, :lineno => lineno, :classname => suite,
|
102
|
+
:assertions => test.assertions, :time => test.time, :file => file_path
|
103
|
+
) do
|
104
|
+
xml << xml_message_for(test) unless test.passed?
|
105
|
+
xml << xml_attachment_for(test) if test.respond_to?('metadata') && test.metadata[:failure_screenshot_path]
|
114
106
|
end
|
115
107
|
end
|
116
108
|
end
|
@@ -155,6 +147,12 @@ module Minitest
|
|
155
147
|
end
|
156
148
|
end
|
157
149
|
|
150
|
+
def xml_attachment_for(test)
|
151
|
+
xml = Builder::XmlMarkup.new(:indent => 2, :margin => 2)
|
152
|
+
|
153
|
+
xml.tag!('system-out', "[[ATTACHMENT|#{test.metadata[:failure_screenshot_path]}]]")
|
154
|
+
end
|
155
|
+
|
158
156
|
def location(exception)
|
159
157
|
last_before_assertion = ''
|
160
158
|
exception.backtrace.reverse_each do |s|
|
@@ -24,7 +24,7 @@ module Minitest
|
|
24
24
|
starting_at: count,
|
25
25
|
progress_mark: green(PROGRESS_MARK),
|
26
26
|
remainder_mark: ' ',
|
27
|
-
format: options.fetch(:format, ' %C
|
27
|
+
format: options.fetch(:format, ' %c/%C: [%B] %p%% %a, %e'),
|
28
28
|
autostart: false
|
29
29
|
)
|
30
30
|
end
|
@@ -12,12 +12,15 @@ module Minitest
|
|
12
12
|
|
13
13
|
# The constructor takes an `options` hash
|
14
14
|
# @param options [Hash]
|
15
|
-
# @option options print_failure_summary [Boolean]
|
16
|
-
# report
|
15
|
+
# @option options print_failure_summary [Boolean] whether to print the errors at the bottom of the
|
16
|
+
# report.
|
17
|
+
# @option options suppress_inline_failure_output [Boolean] whether to suppress the printing of errors
|
18
|
+
# inline with the test results as they occur.
|
17
19
|
#
|
18
20
|
def initialize(options = {})
|
19
21
|
super
|
20
22
|
@print_failure_summary = options[:print_failure_summary]
|
23
|
+
@suppress_inline_failure_output = options[:suppress_inline_failure_output]
|
21
24
|
end
|
22
25
|
|
23
26
|
def start
|
@@ -50,7 +53,7 @@ module Minitest
|
|
50
53
|
def record(test)
|
51
54
|
super
|
52
55
|
record_print_status(test)
|
53
|
-
record_print_failures_if_any(test)
|
56
|
+
record_print_failures_if_any(test) if @suppress_inline_failure_output
|
54
57
|
end
|
55
58
|
|
56
59
|
protected
|
data/minitest-reporters.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ['Alexander Kern']
|
10
10
|
s.email = ['alex@kernul.com']
|
11
|
-
s.homepage = 'https://github.com/
|
11
|
+
s.homepage = 'https://github.com/minitest-reporters/minitest-reporters'
|
12
12
|
s.summary = %q{Create customizable Minitest output formats}
|
13
13
|
s.description = %q{Death to haphazard monkey-patching! Extend Minitest through simple hooks.}
|
14
14
|
s.license = 'MIT'
|
@@ -20,7 +20,6 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_dependency 'ruby-progressbar'
|
21
21
|
s.add_dependency 'builder'
|
22
22
|
|
23
|
-
s.add_development_dependency 'maruku'
|
24
23
|
s.add_development_dependency 'rake'
|
25
24
|
s.add_development_dependency 'rubocop'
|
26
25
|
|
@@ -8,5 +8,21 @@ module MinitestReportersTest
|
|
8
8
|
output = `ruby #{test_filename} 2>&1`
|
9
9
|
refute_match 'No such file or directory', output
|
10
10
|
end
|
11
|
+
|
12
|
+
if Gem::Version.new(Minitest::VERSION) >= Gem::Version.new('5.19.0')
|
13
|
+
def test_outputs_screenshot_metadata
|
14
|
+
test = Minitest::Test.new('test_fail')
|
15
|
+
test.define_singleton_method(:test_fail) { assert false }
|
16
|
+
test.metadata = { failure_screenshot_path: 'screenshot.png' }
|
17
|
+
|
18
|
+
reporter = Minitest::Reporters::JUnitReporter.new('test/tmp')
|
19
|
+
reporter.start
|
20
|
+
reporter.record(test.run)
|
21
|
+
reporter.report
|
22
|
+
|
23
|
+
test_output = File.read('test/tmp/TEST-Minitest-Test.xml')
|
24
|
+
assert_includes test_output, '<system-out>[[ATTACHMENT|screenshot.png]]</system-out>'
|
25
|
+
end
|
26
|
+
end
|
11
27
|
end
|
12
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-reporters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: maruku
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: rake
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -167,7 +153,7 @@ files:
|
|
167
153
|
- test/unit/minitest/minitest_reporter_plugin_test.rb
|
168
154
|
- test/unit/minitest/reporters_test.rb
|
169
155
|
- test/unit/minitest/spec_reporter_test.rb
|
170
|
-
homepage: https://github.com/
|
156
|
+
homepage: https://github.com/minitest-reporters/minitest-reporters
|
171
157
|
licenses:
|
172
158
|
- MIT
|
173
159
|
metadata: {}
|