minitest-heat 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b840b58e068cbca8670479e03202c33c1ca6084ac72c1b84b862f57098a375d
4
- data.tar.gz: ec29ff00bc92f9d1983d988a742f47272354f7137e50e1b67ff10da2b237a486
3
+ metadata.gz: 854fe8325934b81a7dd330ce67af14e20789a9233f33296bf3bd9b794c4dac20
4
+ data.tar.gz: 835c33a68c9efc7f92a9baca779b3844310a74e527f6553f4f12be2967d0691a
5
5
  SHA512:
6
- metadata.gz: b6b68ad844a22dd0b583e0def4bd57dac55bf4e7752e0f96df9db64c7d40edaf794c7cdd5e49261af1212e47e74e8fbfdd7c783ad1c8a2aaadc073b3b7435f74
7
- data.tar.gz: 56de30c8534a10ac407aed531e1db3affbf419a760b39bb2d22aae8f2431c80ea08cced84b64691d377386d852acd3b758d9d8c8069490354165f97b557b115f
6
+ metadata.gz: 030dace3e842475ef5dbeb7c108909ec1faed7d4cc0a2a9219704992908a29d2c6320d21e66fce4229960aea2f4538ab33af493bd10d3f6e70e3fcc0910c0504
7
+ data.tar.gz: 828f273f9e7961f17c4b3a6d35ba6fa4fd020d3075e600e656bbebbb9d8975990e13d6536aec5eb2defb5d2784d4786d3988aa264a27c449230f2723eeedb363
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [2.1.0] - 2026-01-30
4
+
5
+ ### Added
6
+ - `inherently_slow_paths` configuration option to exclude directories (e.g. `test/system`, `test/integration`) from slow test reporting. Tests in listed paths still run and report errors and failures — they just aren't flagged as slow or painfully slow. ([#5](https://github.com/garrettdimon/minitest-heat/issues/5))
7
+
8
+ ## [2.0.0] - 2026-01-29
9
+
3
10
  ### Breaking
4
11
  - Require Ruby >= 3.2 (dropped 3.1 support)
5
12
 
@@ -57,4 +64,3 @@ The biggest update is that the slow thresholds are now configurable.
57
64
  ## [1.0.0] - 2021-12-01
58
65
 
59
66
  Initial release.
60
-
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minitest-heat (2.0.0)
4
+ minitest-heat (2.1.0)
5
5
  minitest
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -67,17 +67,22 @@ Minitest::Heat.configure do |config|
67
67
  end
68
68
  ```
69
69
 
70
- ### Example: Rails Application
70
+ ### Inherently Slow Paths
71
71
 
72
- System tests and integration tests naturally run slower. You might use higher thresholds:
72
+ System tests, integration tests, and other browser-driven tests are inherently slower than unit tests. Rather than raising your global thresholds to accommodate them, you can tell Minitest Heat which paths to exclude from slow test reporting. Tests in those directories still run and report errors and failures normally—they just aren't evaluated against the timing thresholds.
73
73
 
74
74
  ```ruby
75
75
  Minitest::Heat.configure do |config|
76
- config.slow_threshold = 3.0
77
- config.painfully_slow_threshold = 10.0
76
+ config.inherently_slow_paths = ['test/system', 'test/integration']
78
77
  end
79
78
  ```
80
79
 
80
+ Any test whose file path starts with a listed prefix is excluded. Common paths to consider:
81
+
82
+ - `test/system` — Rails system tests (browser-driven)
83
+ - `test/integration` — Integration tests with broader scope
84
+ - `test/e2e` — End-to-end tests
85
+
81
86
  ### Example: Gem Development
82
87
 
83
88
  For a gem with fast unit tests, stricter thresholds catch performance regressions early:
@@ -7,16 +7,23 @@ module Minitest
7
7
  # For managing configuration options on how Minitest Heat should handle results
8
8
  class Configuration
9
9
  DEFAULTS = {
10
- slow_threshold: 1.0,
11
- painfully_slow_threshold: 3.0
10
+ slow_threshold: 1.0,
11
+ painfully_slow_threshold: 3.0,
12
+ inherently_slow_paths: []
12
13
  }.freeze
13
14
 
14
15
  attr_accessor :slow_threshold,
15
- :painfully_slow_threshold
16
+ :painfully_slow_threshold,
17
+ :inherently_slow_paths
16
18
 
17
19
  def initialize
18
- @slow_threshold = DEFAULTS[:slow_threshold]
20
+ @slow_threshold = DEFAULTS[:slow_threshold]
19
21
  @painfully_slow_threshold = DEFAULTS[:painfully_slow_threshold]
22
+ @inherently_slow_paths = DEFAULTS[:inherently_slow_paths].dup
23
+ end
24
+
25
+ def inherently_slow_path?(path)
26
+ inherently_slow_paths.any? { |prefix| path.start_with?(prefix) }
20
27
  end
21
28
  end
22
29
  end
@@ -99,9 +99,9 @@ module Minitest
99
99
  :skipped
100
100
  elsif !passed?
101
101
  :failure
102
- elsif passed? && painful?
102
+ elsif passed? && painful? && !inherently_slow_path?
103
103
  :painful
104
- elsif passed? && slow?
104
+ elsif passed? && slow? && !inherently_slow_path?
105
105
  :slow
106
106
  else
107
107
  :success
@@ -229,6 +229,11 @@ module Minitest
229
229
 
230
230
  private
231
231
 
232
+ def inherently_slow_path?
233
+ path = locations.test_definition.relative_filename
234
+ Minitest::Heat.configuration.inherently_slow_path?(path)
235
+ end
236
+
232
237
  def failure_location_hash
233
238
  location = locations.most_relevant
234
239
  return nil if location.nil?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Minitest
4
4
  module Heat
5
- VERSION = '2.0.0'
5
+ VERSION = '2.1.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-heat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garrett Dimon