test_bench-isolated 2.0.0.1 → 2.0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/test_bench_isolated/test_bench/cli.rb +11 -4
- data/lib/test_bench_isolated/test_bench/run/get_files.rb +1 -1
- data/lib/test_bench_isolated/test_bench/run/run.rb +11 -9
- data/lib/test_bench_isolated/test_bench/session/session.rb +23 -0
- data/script/bench +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 116ae637aa2c6479597875939fdb7a6133778abee6224441872f619b7d6997fd
|
4
|
+
data.tar.gz: 4240ebfd27180fdc1d7c876d1f5e10e9e5dc528fda3f8754013ce1b4452469de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff36269a0129363eaaa1e7d727b439f44937b8a0c54f85c10159e6a47bdd9338018ab8773da9aa0d6dfd904b0889b36e11299d361cb7efe304e2da22cb83bf63
|
7
|
+
data.tar.gz: 7d9dbf18961597a84facb32afec7b5ba83c070209eb787c0eacd72bd49605e4e515cef6b51b4fde6c1afc65bc56dd25f5f703564a5ad29f8b87671c655ae7565
|
@@ -148,12 +148,19 @@ module TestBenchIsolated
|
|
148
148
|
|
149
149
|
when '-x', '--exclude', '--no-exclude'
|
150
150
|
if not negated?(switch)
|
151
|
-
|
151
|
+
exclude_pattern_text = switch_value!(argument_index, switch)
|
152
|
+
|
153
|
+
if env.key?('TEST_BENCH_EXCLUDE_FILE_PATTERN')
|
154
|
+
exclude_pattern_text = [
|
155
|
+
env['TEST_BENCH_EXCLUDE_FILE_PATTERN'],
|
156
|
+
exclude_pattern_text
|
157
|
+
].join(':')
|
158
|
+
end
|
152
159
|
else
|
153
|
-
|
160
|
+
exclude_pattern_text = ''
|
154
161
|
end
|
155
162
|
|
156
|
-
env['TEST_BENCH_EXCLUDE_FILE_PATTERN'] =
|
163
|
+
env['TEST_BENCH_EXCLUDE_FILE_PATTERN'] = exclude_pattern_text
|
157
164
|
|
158
165
|
when '-f', '--only-failure', '--no-only-failure'
|
159
166
|
if not negated?(switch)
|
@@ -206,7 +213,7 @@ module TestBenchIsolated
|
|
206
213
|
|
207
214
|
Configuration Options:
|
208
215
|
\t-d, --[no]detail Always show (or hide) details (Default: #{Session::Output::Detail.default})
|
209
|
-
\t-x, --[no-]exclude PATTERN Do not execute test files matching PATTERN (Default: #{Run::GetFiles::Defaults.
|
216
|
+
\t-x, --[no-]exclude PATTERN Do not execute test files matching PATTERN (Default: #{Run::GetFiles::Defaults.exclude_patterns.inspect})
|
210
217
|
\t-f, --[no-]only-failure Don't display output for test files that pass (Default: #{Run::Output::File::Defaults.only_failure ? 'on' : 'off'})
|
211
218
|
\t-o, --output-styling [on|off|detect]
|
212
219
|
\t Render output coloring and font styling escape codes (Default: #{Output::Writer::Styling.default})
|
@@ -35,7 +35,7 @@ module TestBenchIsolated
|
|
35
35
|
end
|
36
36
|
attr_writer :path_sequence
|
37
37
|
|
38
|
-
def self.build(exclude: nil)
|
38
|
+
def self.build(exclude: nil, session: nil)
|
39
39
|
instance = new
|
40
40
|
|
41
41
|
GetFiles.configure(instance, exclude:)
|
@@ -44,14 +44,16 @@ module TestBenchIsolated
|
|
44
44
|
|
45
45
|
Random.configure(instance)
|
46
46
|
|
47
|
-
session
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
if session.nil?
|
48
|
+
session = Session.build do |telemetry|
|
49
|
+
Output::File.register(telemetry)
|
50
|
+
Output::Summary::Error.register(telemetry)
|
51
|
+
Output::Summary.register(telemetry)
|
52
|
+
end
|
53
53
|
end
|
54
54
|
|
55
|
+
instance.telemetry = session.telemetry
|
56
|
+
|
55
57
|
Session.configure(instance, session:)
|
56
58
|
|
57
59
|
instance
|
@@ -67,10 +69,10 @@ module TestBenchIsolated
|
|
67
69
|
instance.(path)
|
68
70
|
end
|
69
71
|
|
70
|
-
def self.configure(receiver, exclude: nil, attr_name: nil)
|
72
|
+
def self.configure(receiver, exclude: nil, session: nil, attr_name: nil)
|
71
73
|
attr_name ||= :run
|
72
74
|
|
73
|
-
instance = build(exclude:)
|
75
|
+
instance = build(exclude:, session:)
|
74
76
|
receiver.public_send(:"#{attr_name}=", instance)
|
75
77
|
end
|
76
78
|
|
@@ -44,6 +44,29 @@ module TestBenchIsolated
|
|
44
44
|
receiver.public_send(:"#{attr_name}=", instance)
|
45
45
|
end
|
46
46
|
|
47
|
+
def inspect
|
48
|
+
text = self.to_s
|
49
|
+
|
50
|
+
instance_variables = self.instance_variables - [:@telemetry]
|
51
|
+
|
52
|
+
instance_variables.each_with_index do |name, index|
|
53
|
+
ivar_text = String.new
|
54
|
+
|
55
|
+
if index > 0
|
56
|
+
ivar_text << ','
|
57
|
+
end
|
58
|
+
|
59
|
+
value = instance_variable_get(name)
|
60
|
+
value = value.inspect
|
61
|
+
|
62
|
+
ivar_text << " #{name}=#{value}"
|
63
|
+
|
64
|
+
text.insert(-2, ivar_text)
|
65
|
+
end
|
66
|
+
|
67
|
+
text
|
68
|
+
end
|
69
|
+
|
47
70
|
def passed?
|
48
71
|
asserted? && !failed? && !skipped?
|
49
72
|
end
|
data/script/bench
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_bench-isolated
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Ladd
|
8
8
|
autorequire:
|
9
9
|
bindir: script
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: nathanladd+github@gmail.com
|