turbo_tests 2.1.0 → 2.2.0

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: 25d450704814f1459f2f64c64c23c60deaf1b895c561537eecce66af9f5000b7
4
- data.tar.gz: 226f82aaa2e91a3498a6b341c0f0b06c890f95b264809ef78da3d6d8d422360b
3
+ metadata.gz: 4333741571516dc714d516eac90fb9cf56236b7084935e9ebdfa313becf842d5
4
+ data.tar.gz: 56c3df79a128084822f5bb88de6500bc6e3e254041609a6329b7b587f180298b
5
5
  SHA512:
6
- metadata.gz: c56e3b2f7d3f9653deb3e2eca066236687d42a7ffb9fd59a44dd55dcfe0eb84ea8e25018d0566211cc8902acea8e847c0a2e05e86a67944c3eabef2d76bafc77
7
- data.tar.gz: 602961dd98f96cc36e258891409c7cf6ff9f681ce63116915d3b8ce27138a963818d17670e38fc20ed3a7fd08bf2e05313cd925b93a2d3ee0980db359bd77dea
6
+ metadata.gz: f9e1d084a510a334be437dcc200d496118e05b65b7b61730dfe8b1de3b90014de73f7108754a8fc3caac216bbebdec858798d2a798db43a87bb2f2fdd108edb6
7
+ data.tar.gz: 8fc6250f94c926eacbebca503a90640ed30998430a54ed31bf97d8bfc090b92f35202a043dbe08f28c42432fd9f300c7ba357d3bd3ee17daa95ea0adc3e457cc
@@ -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
@@ -26,4 +26,4 @@ jobs:
26
26
  - name: Run tests
27
27
  timeout-minutes: 5
28
28
  run: |
29
- ${{matrix.env}} bundle exec turbo_tests -n4
29
+ bundle exec turbo_tests -n4
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turbo_tests (2.1.0)
5
- bundler (>= 2.1)
4
+ turbo_tests (2.2.0)
6
5
  parallel_tests (>= 3.3.0, < 5)
7
6
  rspec (>= 3.10)
8
7
 
@@ -42,4 +41,4 @@ DEPENDENCIES
42
41
  turbo_tests!
43
42
 
44
43
  BUNDLED WITH
45
- 2.4.6
44
+ 2.4.19
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?)
@@ -150,7 +160,7 @@ module TurboTests
150
160
  command = [
151
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,
@@ -1,3 +1,3 @@
1
1
  module TurboTests
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
data/turbo_tests.gemspec CHANGED
@@ -24,8 +24,6 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_development_dependency "pry", "~> 0.14"
26
26
 
27
- spec.add_runtime_dependency "bundler", ">= 2.1"
28
-
29
27
  # Specify which files should be added to the gem when it is released.
30
28
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
31
29
  spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
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.1.0
4
+ version: 2.2.0
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-26 00:00:00.000000000 Z
11
+ date: 2023-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -58,20 +58,6 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0.14'
61
- - !ruby/object:Gem::Dependency
62
- name: bundler
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '2.1'
68
- type: :runtime
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: '2.1'
75
61
  description:
76
62
  email:
77
63
  - ilya@serpapi.com