minitest-allow 1.0.0 → 1.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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.rdoc +7 -0
- data/lib/minitest/allow_plugin.rb +39 -10
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f24ec8511a2369224f41c4a036d52efa431c102690aa1f933097a863e13df8e0
|
4
|
+
data.tar.gz: b5e459178923fd55debdc76f1bd8e0647ababe7fccb457839c2f2599c0bb8f7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4e5a3e8bfda70b669f185b92280ea1146a18a61533d5508d256ea72f04672e1f3691505dad3b0c643d46ec98577bf681170cc7605c0db1edc82f1d60861eaa3
|
7
|
+
data.tar.gz: e9d36c2adcb5fa8005b4e2a7eeeecfe35b20bc0822f02ecccd71b419f6e63ffa46a7d544363ffffcf917d4105cc3e3bb23a9b8e36f3248a47ff088702cd46b21
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
=== 1.1.0 / 2021-04-19
|
2
|
+
|
3
|
+
* 2 minor enhancements:
|
4
|
+
|
5
|
+
* This works even when running subsets of tests (eg parallel in a CI)
|
6
|
+
* Tracks tests that are allowed yet pass and can thus be removed from allowed list.
|
7
|
+
|
1
8
|
=== 1.0.0 / 2021-04-02
|
2
9
|
|
3
10
|
* 1 major enhancement
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Minitest
|
2
2
|
def self.plugin_allow_options opts, _options # :nodoc:
|
3
|
+
@allow = @allow_save = false
|
4
|
+
|
3
5
|
opts.on "-a", "--allow=path", String, "Allow listed tests to fail." do |f|
|
4
6
|
require "yaml"
|
5
7
|
@allow = YAML.load File.read f
|
@@ -14,10 +16,10 @@ module Minitest
|
|
14
16
|
def self.plugin_allow_init options # :nodoc:
|
15
17
|
if @allow || @allow_save then
|
16
18
|
self.reporter.extend Allow
|
19
|
+
self.reporter.allow = @allow
|
20
|
+
self.reporter.allow_save = @allow_save
|
21
|
+
self.reporter.allow_seen = []
|
17
22
|
end
|
18
|
-
|
19
|
-
self.reporter.allow = @allow if @allow
|
20
|
-
self.reporter.allow_save = @allow_save if @allow_save
|
21
23
|
end
|
22
24
|
|
23
25
|
class Result # TODO: push up
|
@@ -26,10 +28,21 @@ module Minitest
|
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
31
|
+
class Minitest::Test # sigh... rails
|
32
|
+
def full_name
|
33
|
+
"%s#%s" % [self.class, name]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
29
37
|
module Allow
|
30
|
-
VERSION = "1.
|
38
|
+
VERSION = "1.1.0"
|
31
39
|
|
32
|
-
attr_accessor :allow, :allow_save
|
40
|
+
attr_accessor :allow, :allow_save, :allow_seen
|
41
|
+
|
42
|
+
def record result
|
43
|
+
allow_seen << result.full_name
|
44
|
+
super
|
45
|
+
end
|
33
46
|
|
34
47
|
def allow_results
|
35
48
|
self.reporters
|
@@ -39,7 +52,8 @@ module Minitest
|
|
39
52
|
|
40
53
|
def write_allow
|
41
54
|
data = allow_results
|
42
|
-
.
|
55
|
+
.flatten
|
56
|
+
.map(&:full_name)
|
43
57
|
.uniq
|
44
58
|
.sort
|
45
59
|
|
@@ -47,18 +61,33 @@ module Minitest
|
|
47
61
|
end
|
48
62
|
|
49
63
|
def filter_allow
|
64
|
+
maybe_bad = allow_results.flatten.map(&:full_name).uniq
|
65
|
+
to_remove = maybe_bad & allow
|
66
|
+
extra_bad = maybe_bad - to_remove
|
67
|
+
|
68
|
+
self.allow -= to_remove
|
69
|
+
|
50
70
|
allow_results.each do |results|
|
51
|
-
results.delete_if { |r|
|
71
|
+
results.delete_if { |r| to_remove.include? r.full_name }
|
72
|
+
end
|
73
|
+
|
74
|
+
unless extra_bad.empty? then
|
75
|
+
io.puts
|
76
|
+
io.puts "Bad tests that are NOT allowed:"
|
77
|
+
io.puts
|
78
|
+
io.puts extra_bad.to_yaml
|
52
79
|
end
|
53
80
|
end
|
54
81
|
|
55
82
|
def report_extra_allow
|
56
|
-
|
83
|
+
good = allow & allow_seen
|
84
|
+
|
85
|
+
unless good.empty? then
|
57
86
|
io.puts
|
58
87
|
io.puts "Excluded tests that now pass:"
|
59
88
|
io.puts
|
60
|
-
|
61
|
-
io.puts "
|
89
|
+
good.each do |name|
|
90
|
+
io.puts " :allow_good: %p" % [name]
|
62
91
|
end
|
63
92
|
end
|
64
93
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-allow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
d/AHw/kcnU6iuMUoJEcGiJd4gVCTn1l3cDcIvxakGslCA88Jubw0Sqatan0TnC9g
|
30
30
|
KToW560QIey7SPfHWduzFJnV
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2021-04-
|
32
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: minitest
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.2.
|
126
|
+
rubygems_version: 3.2.16
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Allows you to provide an exclusion list of allowed failures/errors
|
metadata.gz.sig
CHANGED
Binary file
|