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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0799077faf665b499dbb66c0ae8c59337a559944c7bab9c6151a65d74ae6e7d4'
4
- data.tar.gz: 2c5a723bf7a2cfe9ebb0a0eadbab3572b9e9aee92ee8276e29f136cf8cbf8f32
3
+ metadata.gz: 2879bcea878f083aa68fbe65f9018e3ab035fad0107f13a96ac6c1556ccc8828
4
+ data.tar.gz: 96a4a90beba7ef92e8a39a00442b93639407941eee7108d0e13d854db3e24a92
5
5
  SHA512:
6
- metadata.gz: c942f5cd7703dfead41cc9cac9d52902e3ee29ec869f02bfbe3b49d91e4a80027fdf4bc1cd8014c41a6757a29a6f0df2580a136d5fa10f4d2babc2850fc8ef4d
7
- data.tar.gz: b1ac417107631fbdb8a822253eb60cc676467aace519f2aa8e67c175df38649c5de52d29ab03b5bb19754c9dcc907393d9da5904cf94a21eb45d91bbe321fd06
6
+ metadata.gz: 6fa02b1fc9b504327a96e11c30ce4a7f5061c96970519a8541835cde05cea47286c80434a6c2dfe56071db1b703bda220213386d2f3918d0ea4438c1a7efad5f
7
+ data.tar.gz: 9983094d4663a9c9f26740c996e74543e22aab729fa24f5517c2ce467bdb1b28c59ff4798c36822b2553f2a4c8749a29f76327312abf143677cee6afabc2e621
@@ -13,7 +13,7 @@ jobs:
13
13
  strategy:
14
14
  fail-fast: true
15
15
  matrix:
16
- ruby: [ 2.7, 3.0, 3.1, 3.2 ]
16
+ ruby: [ 2.7, "3.0", 3.1, 3.2 ]
17
17
 
18
18
  steps:
19
19
  - uses: actions/checkout@v3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turbo_tests (2.0.0)
4
+ turbo_tests (2.1.1)
5
5
  bundler (>= 2.1)
6
6
  parallel_tests (>= 3.3.0, < 5)
7
7
  rspec (>= 3.10)
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
@@ -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
@@ -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)
@@ -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
- ENV["BUNDLE_BIN_PATH"], "exec", "rspec",
161
+ "rspec",
152
162
  *extra_args,
153
- "--seed", rand(0xFFFF).to_s,
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 = [
@@ -1,3 +1,3 @@
1
1
  module TurboTests
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.1"
3
3
  end
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.0.0
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-05-17 00:00:00.000000000 Z
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec