turbo_tests 2.0.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/turbo_tests/cli.rb +6 -0
- data/lib/turbo_tests/reporter.rb +5 -0
- data/lib/turbo_tests/runner.rb +14 -3
- data/lib/turbo_tests/version.rb +1 -1
- 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: 2879bcea878f083aa68fbe65f9018e3ab035fad0107f13a96ac6c1556ccc8828
|
4
|
+
data.tar.gz: 96a4a90beba7ef92e8a39a00442b93639407941eee7108d0e13d854db3e24a92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fa02b1fc9b504327a96e11c30ce4a7f5061c96970519a8541835cde05cea47286c80434a6c2dfe56071db1b703bda220213386d2f3918d0ea4438c1a7efad5f
|
7
|
+
data.tar.gz: 9983094d4663a9c9f26740c996e74543e22aab729fa24f5517c2ce467bdb1b28c59ff4798c36822b2553f2a4c8749a29f76327312abf143677cee6afabc2e621
|
data/.github/workflows/tests.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<div align="center">
|
6
6
|
<img src="https://user-images.githubusercontent.com/78694043/233910064-87a6d557-1120-42d2-b965-2a9403c6f2f4.svg" width="500" alt="Turbo-Tests">
|
7
|
-
|
7
|
+
|
8
8
|
</div>
|
9
9
|
|
10
10
|
<div align="center">
|
@@ -96,6 +96,7 @@ Options:
|
|
96
96
|
--runtime-log FILE Location of previously recorded test runtimes
|
97
97
|
-v, --verbose More output
|
98
98
|
--fail-fast=[N]
|
99
|
+
--seed SEED Seed for rspec
|
99
100
|
```
|
100
101
|
|
101
102
|
## Development
|
data/lib/turbo_tests/cli.rb
CHANGED
@@ -16,6 +16,7 @@ module TurboTests
|
|
16
16
|
runtime_log = nil
|
17
17
|
verbose = false
|
18
18
|
fail_fast = nil
|
19
|
+
seed = nil
|
19
20
|
|
20
21
|
OptionParser.new { |opts|
|
21
22
|
opts.banner = <<~BANNER
|
@@ -76,6 +77,10 @@ module TurboTests
|
|
76
77
|
end
|
77
78
|
fail_fast = n.nil? || n < 1 ? 1 : n
|
78
79
|
end
|
80
|
+
|
81
|
+
opts.on("--seed SEED", "Seed for rspec") do |s|
|
82
|
+
seed = s
|
83
|
+
end
|
79
84
|
}.parse!(@argv)
|
80
85
|
|
81
86
|
requires.each { |f| require(f) }
|
@@ -101,6 +106,7 @@ module TurboTests
|
|
101
106
|
verbose: verbose,
|
102
107
|
fail_fast: fail_fast,
|
103
108
|
count: count,
|
109
|
+
seed: seed
|
104
110
|
)
|
105
111
|
|
106
112
|
if success
|
data/lib/turbo_tests/reporter.rb
CHANGED
@@ -114,6 +114,11 @@ module TurboTests
|
|
114
114
|
RSpec::Core::Notifications::NullNotification)
|
115
115
|
end
|
116
116
|
|
117
|
+
def seed_notification(seed, seed_used)
|
118
|
+
puts RSpec::Core::Notifications::SeedNotification.new(seed, seed_used).fully_formatted
|
119
|
+
puts
|
120
|
+
end
|
121
|
+
|
117
122
|
protected
|
118
123
|
|
119
124
|
def delegate_to_formatters(method, *args)
|
data/lib/turbo_tests/runner.rb
CHANGED
@@ -20,6 +20,8 @@ module TurboTests
|
|
20
20
|
verbose = opts.fetch(:verbose, false)
|
21
21
|
fail_fast = opts.fetch(:fail_fast, nil)
|
22
22
|
count = opts.fetch(:count, nil)
|
23
|
+
seed = opts.fetch(:seed) || rand(0xFFFF).to_s
|
24
|
+
seed_used = !opts[:seed].nil?
|
23
25
|
|
24
26
|
if verbose
|
25
27
|
STDERR.puts "VERBOSE"
|
@@ -34,7 +36,9 @@ module TurboTests
|
|
34
36
|
runtime_log: runtime_log,
|
35
37
|
verbose: verbose,
|
36
38
|
fail_fast: fail_fast,
|
37
|
-
count: count
|
39
|
+
count: count,
|
40
|
+
seed: seed,
|
41
|
+
seed_used: seed_used
|
38
42
|
).run
|
39
43
|
end
|
40
44
|
|
@@ -49,6 +53,8 @@ module TurboTests
|
|
49
53
|
@load_time = 0
|
50
54
|
@load_count = 0
|
51
55
|
@failure_count = 0
|
56
|
+
@seed = opts[:seed]
|
57
|
+
@seed_used = opts[:seed_used]
|
52
58
|
|
53
59
|
@messages = Thread::Queue.new
|
54
60
|
@threads = []
|
@@ -86,6 +92,8 @@ module TurboTests
|
|
86
92
|
|
87
93
|
report_number_of_tests(tests_in_groups)
|
88
94
|
|
95
|
+
@reporter.seed_notification(@seed, @seed_used)
|
96
|
+
|
89
97
|
wait_threads = tests_in_groups.map.with_index do |tests, process_id|
|
90
98
|
start_regular_subprocess(tests, process_id + 1, **subprocess_opts)
|
91
99
|
end
|
@@ -94,6 +102,8 @@ module TurboTests
|
|
94
102
|
|
95
103
|
@reporter.finish
|
96
104
|
|
105
|
+
@reporter.seed_notification(@seed, @seed_used)
|
106
|
+
|
97
107
|
@threads.each(&:join)
|
98
108
|
|
99
109
|
@reporter.failed_examples.empty? && wait_threads.map(&:value).all?(&:success?)
|
@@ -148,14 +158,15 @@ module TurboTests
|
|
148
158
|
end
|
149
159
|
|
150
160
|
command = [
|
151
|
-
|
161
|
+
"rspec",
|
152
162
|
*extra_args,
|
153
|
-
"--seed",
|
163
|
+
"--seed", @seed,
|
154
164
|
"--format", "TurboTests::JsonRowsFormatter",
|
155
165
|
"--out", tmp_filename,
|
156
166
|
*record_runtime_options,
|
157
167
|
*tests
|
158
168
|
]
|
169
|
+
command.unshift(ENV["BUNDLE_BIN_PATH"], "exec") if ENV["BUNDLE_BIN_PATH"]
|
159
170
|
|
160
171
|
if @verbose
|
161
172
|
command_str = [
|
data/lib/turbo_tests/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbo_tests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Illia Zub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|