minitest-reporters 1.4.3 → 1.5.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: 120b4ce6a1a42386c94c34efee2b65fe1964e75d2532553850f39964a7cbe832
4
- data.tar.gz: 7ea83aff68338ad236208a6622b4f3b746cbf330d3189897a4edeae064d05a01
3
+ metadata.gz: 2e6b7a770ddd1f72abb68531badb27cb13fc38189c0f638d91b7244c5a2856c9
4
+ data.tar.gz: 44b074935fd563c3be78833b59a5aba4c0faad662b5adb6d531f4adc7180bd62
5
5
  SHA512:
6
- metadata.gz: a1062e3fac40dc4ad46aa3ee6be1f9996bd9b10877b1610083e40372adc6548396d9b7c83edd3c9034447d244e78c463669754498d7b5dd2d99b8d169deb1eb6
7
- data.tar.gz: 0c99ed679c71e933e858faa088fa452351ebc0a1f18663a865e1c59741ce99b9d9a55c05b27fb4bd8a2b184da789c3e20f83e13d1a7cdcb049bd7ec45fcf1c6a
6
+ metadata.gz: 9cee23ccb7b443ef4fefea6a8420e3452d171d0c544b6835c1442658616a5db513182ba1dc77731259050fc2431b47e318ff0c116d4a20d7a592bba100b9837e
7
+ data.tar.gz: 216c4f9cabcb7d43304266c3bbb83bf033ad84686bc7258f8c6b6f5dd9970fdc6fc66655bf76e94f27728bd0afb924ef030e29fc8a9a75753f0f879487f9a47a
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
- ### [dev](https://github.com/kern/minitest-reporters/compare/v1.4.3...master)
1
+ ### [dev](https://github.com/kern/minitest-reporters/compare/v1.5.0...master)
2
2
 
3
- ### [1.4.3](https://github.com/kern/minitest-reporters/compare/v1.4.3...v1.4.2)
3
+ ### [1.5.0](https://github.com/kern/minitest-reporters/compare/v1.4.3...v1.5.0)
4
+
5
+ * Added support for environment variables to define the output location of HTML reports. [#311](https://github.com/minitest-reporters/minitest-reporters/pull/311) contributed by [estebanbouza](https://github.com/estebanbouza)
6
+ * Fixed ProgressReporter accuracy on skipped tests while `detailed_skip` is disabled [#312](https://github.com/minitest-reporters/minitest-reporters/pull/312) contributed by [seven1m](https://github.com/seven1m)
7
+ * Added `file` attribute to `<testcase>` tags in JUnitReporter for CircleCI compatibility [#313](https://github.com/minitest-reporters/minitest-reporters/pull/313) contributed by [nbudin](https://github.com/nbudin)
8
+ * Added timestamp option to JUnitReporter [#316] (https://github.com/minitest-reporters/minitest-reporters/pull/316) contributed by [sipani909](https://github.com/sipani909)
9
+
10
+ ### [1.4.3](https://github.com/kern/minitest-reporters/compare/v1.4.2...v1.4.3)
4
11
 
5
12
  * fixed rare compatability issue between JUnitReporter and older versions of Minitest [#272](https://github.com/minitest-reporters/minitest-reporters/pull/272) contributed by [chakrit](https://github.com/chakrit)
6
13
  * fixed JUnitReporter to use a relative file path if a file path is absolute [#305](https://github.com/minitest-reporters/minitest-reporters/issues/305)
@@ -64,7 +71,7 @@
64
71
 
65
72
  * SpecReporter do not print exception name any more (unless it is an test error) [#264](https://github.com/kern/minitest-reporters/issues/264)
66
73
  * Fixed loading error caused by fix for [#265](https://github.com/kern/minitest-reporters/pull/265)
67
- see [#267](https://github.com/kern/minitest-reporters/issues/267) and
74
+ see [#267](https://github.com/kern/minitest-reporters/issues/267) and
68
75
  [#268](https://github.com/kern/minitest-reporters/pull/268) for more details.
69
76
 
70
77
  ### [1.3.1](https://github.com/kern/minitest-reporters/compare/v1.3.1.beta1...v1.3.1)
data/README.md CHANGED
@@ -36,7 +36,7 @@ Want to use multiple reporters?
36
36
  Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new, Minitest::Reporters::JUnitReporter.new]
37
37
  ```
38
38
 
39
- If RubyMate, TeamCity, RubyMine or VIM presence is detected, the reporter will be automatically chosen,
39
+ If TextMate, TeamCity, RubyMine or VIM presence is detected, the reporter will be automatically chosen,
40
40
  regardless of any reporters passed to the `use!` method.
41
41
 
42
42
  To override this behavior, you may set the ENV variable MINITEST_REPORTER:
@@ -60,9 +60,9 @@ module Minitest
60
60
  defaults = {
61
61
  :title => 'Test Results',
62
62
  :erb_template => "#{File.dirname(__FILE__)}/../templates/index.html.erb",
63
- :reports_dir => 'test/html_reports',
63
+ :reports_dir => ENV['MINITEST_HTML_REPORTS_DIR'] || 'test/html_reports',
64
64
  :mode => :safe,
65
- :output_filename => 'index.html',
65
+ :output_filename => ENV['MINITEST_HTML_REPORTS_FILENAME'] || 'index.html',
66
66
  }
67
67
 
68
68
  settings = defaults.merge(args)
@@ -3,6 +3,8 @@
3
3
  require 'builder'
4
4
  require 'fileutils'
5
5
  require 'pathname'
6
+ require 'time'
7
+
6
8
  module Minitest
7
9
  module Reporters
8
10
  # A reporter for writing JUnit test reports
@@ -21,6 +23,7 @@ module Minitest
21
23
  @reports_path = File.absolute_path(ENV.fetch("MINITEST_REPORTERS_REPORTS_DIR", reports_dir))
22
24
  @single_file = options[:single_file]
23
25
  @base_path = options[:base_path] || Dir.pwd
26
+ @timestamp_report = options[:include_timestamp]
24
27
 
25
28
  return unless empty
26
29
 
@@ -83,15 +86,31 @@ module Minitest
83
86
  suite_result = analyze_suite(tests)
84
87
  file_path = get_relative_path(tests.first)
85
88
 
86
- xml.testsuite(:name => suite, :filepath => file_path,
87
- :skipped => suite_result[:skip_count], :failures => suite_result[:fail_count],
88
- :errors => suite_result[:error_count], :tests => suite_result[:test_count],
89
- :assertions => suite_result[:assertion_count], :time => suite_result[:time]) do
90
- tests.each do |test|
91
- lineno = get_source_location(test).last
92
- xml.testcase(:name => test.name, :lineno => lineno, :classname => suite, :assertions => test.assertions,
93
- :time => test.time) do
94
- xml << xml_message_for(test) unless test.passed?
89
+ if @timestamp_report
90
+ xml.testsuite(:name => suite, :filepath => file_path,
91
+ :skipped => suite_result[:skip_count], :failures => suite_result[:fail_count],
92
+ :errors => suite_result[:error_count], :tests => suite_result[:test_count],
93
+ :assertions => suite_result[:assertion_count], :time => suite_result[:time],
94
+ :timestamp => suite_result[:timestamp]) do
95
+ tests.each do |test|
96
+ lineno = get_source_location(test).last
97
+ xml.testcase(:name => test.name, :lineno => lineno, :classname => suite, :assertions => test.assertions,
98
+ :time => test.time, :file => file_path) do
99
+ xml << xml_message_for(test) unless test.passed?
100
+ end
101
+ end
102
+ end
103
+ else
104
+ xml.testsuite(:name => suite, :filepath => file_path,
105
+ :skipped => suite_result[:skip_count], :failures => suite_result[:fail_count],
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
95
114
  end
96
115
  end
97
116
  end
@@ -154,6 +173,7 @@ module Minitest
154
173
  result[:assertion_count] += test.assertions
155
174
  result[:test_count] += 1
156
175
  result[:time] += test.time
176
+ result[:timestamp] = Time.now.iso8601 if @timestamp_report
157
177
  end
158
178
  result
159
179
  end
@@ -48,7 +48,7 @@ module Minitest
48
48
 
49
49
  def record(test)
50
50
  super
51
- return if test.skipped? && !@detailed_skip
51
+ return show if test.skipped? && !@detailed_skip
52
52
  if test.failure
53
53
  print "\e[0m\e[1000D\e[K"
54
54
  print_colored_status(test)
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Reporters
3
- VERSION = '1.4.3'.freeze
3
+ VERSION = '1.5.0'.freeze
4
4
  end
5
5
  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.3
4
+ version: 1.5.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: 2021-01-23 00:00:00.000000000 Z
11
+ date: 2022-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -185,26 +185,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  - !ruby/object:Gem::Version
186
186
  version: '0'
187
187
  requirements: []
188
- rubygems_version: 3.1.4
188
+ rubygems_version: 3.3.3
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: Create customizable Minitest output formats
192
- test_files:
193
- - test/fixtures/junit_filename_bug_example_test.rb
194
- - test/fixtures/mean_time_test.rb
195
- - test/fixtures/progress_detailed_skip_test.rb
196
- - test/fixtures/progress_test.rb
197
- - test/fixtures/sample_test.rb
198
- - test/fixtures/spec_test.rb
199
- - test/gallery/bad_test.rb
200
- - test/gallery/good_test.rb
201
- - test/integration/reporters/junit_reporter_test.rb
202
- - test/integration/reporters/mean_time_reporter_test.rb
203
- - test/integration/reporters/progress_reporter_test.rb
204
- - test/test_helper.rb
205
- - test/unit/minitest/extensible_backtrace_filter_test.rb
206
- - test/unit/minitest/junit_reporter_test.rb
207
- - test/unit/minitest/mean_time_reporter_unit_test.rb
208
- - test/unit/minitest/minitest_reporter_plugin_test.rb
209
- - test/unit/minitest/reporters_test.rb
210
- - test/unit/minitest/spec_reporter_test.rb
192
+ test_files: []