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 +4 -4
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +1 -1
- data/README.md +9 -4
- data/lib/minitest/heat/configuration.rb +11 -4
- data/lib/minitest/heat/issue.rb +7 -2
- data/lib/minitest/heat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 854fe8325934b81a7dd330ce67af14e20789a9233f33296bf3bd9b794c4dac20
|
|
4
|
+
data.tar.gz: 835c33a68c9efc7f92a9baca779b3844310a74e527f6553f4f12be2967d0691a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
data/README.md
CHANGED
|
@@ -67,17 +67,22 @@ Minitest::Heat.configure do |config|
|
|
|
67
67
|
end
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
###
|
|
70
|
+
### Inherently Slow Paths
|
|
71
71
|
|
|
72
|
-
System tests and
|
|
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.
|
|
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:
|
|
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
|
|
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
|
data/lib/minitest/heat/issue.rb
CHANGED
|
@@ -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?
|