semaphore_test_boosters 1.5.0 → 1.6.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
- data/README.md +8 -8
- data/exe/cucumber_booster +5 -2
- data/exe/rspec_booster +6 -3
- data/lib/test_boosters/cli_parser.rb +6 -1
- data/lib/test_boosters/cucumber/booster.rb +6 -6
- data/lib/test_boosters/rspec/booster.rb +6 -6
- data/lib/test_boosters/split_configuration.rb +0 -4
- data/lib/test_boosters/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bff6de7b2b6b825256febbd7216cbc9c04aa975
|
4
|
+
data.tar.gz: d09cebc9ccf010b681e0ff029e50cbb40b917821
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9b2e14becb7b8c927abab15f9e28bac3e37792a5f05be90a80a77ac3d8355faaa50ceaf0682d61031eabe252dae5756824b04c11b89b591a3dd044c9fcc7ee6
|
7
|
+
data.tar.gz: 43f80ca1454e626136765aef6617ac0be6e1d09e30513b8ea98125dcefb888c90352bb0da0dcd00bd8b38f3be4f304991ccf1692d170fe7d4f8d0c3a3fc50ea6
|
data/README.md
CHANGED
@@ -7,14 +7,14 @@ Auto Parallelization — runs test files in multiple threads.
|
|
7
7
|
## Installation
|
8
8
|
|
9
9
|
``` bash
|
10
|
-
gem install
|
10
|
+
gem install semaphore_test_boosters
|
11
11
|
````
|
12
12
|
|
13
13
|
## Usage
|
14
14
|
|
15
15
|
### RSpec Booster
|
16
16
|
|
17
|
-
The RSpec booster command allows you to run one out of several parallel
|
17
|
+
The RSpec booster command allows you to run one out of several parallel RSpec
|
18
18
|
threads.
|
19
19
|
|
20
20
|
``` bash
|
@@ -32,9 +32,9 @@ directory with the following content:
|
|
32
32
|
|
33
33
|
``` json
|
34
34
|
[
|
35
|
-
{ :
|
36
|
-
{ :
|
37
|
-
{ :
|
35
|
+
{ "files": ["spec/a_spec.rb", "spec/b_spec.rb"] },
|
36
|
+
{ "files": ["spec/c_spec.rb", "spec/d_spec.rb"] },
|
37
|
+
{ "files": ["spec/e_spec.rb"] }
|
38
38
|
]
|
39
39
|
```
|
40
40
|
|
@@ -54,9 +54,9 @@ For example, if you have the following split configuration:
|
|
54
54
|
|
55
55
|
``` json
|
56
56
|
[
|
57
|
-
{ :
|
58
|
-
{ :
|
59
|
-
{ :
|
57
|
+
{ "files": ["spec/a_spec.rb"] }
|
58
|
+
{ "files": ["spec/b_spec.rb"] }
|
59
|
+
{ "files": ["spec/c_spec.rb"] }
|
60
60
|
]
|
61
61
|
```
|
62
62
|
|
data/exe/cucumber_booster
CHANGED
@@ -3,7 +3,10 @@
|
|
3
3
|
require "test_boosters"
|
4
4
|
|
5
5
|
cli_options = TestBoosters::CliParser.parse
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
thread_index = cli_options[:thread_index] - 1
|
8
|
+
thread_count = cli_options[:thread_count]
|
9
|
+
|
10
|
+
cucumber_booster = TestBoosters::Cucumber::Booster.new(thread_index, thread_count)
|
8
11
|
|
9
12
|
exit(cucumber_booster.run)
|
data/exe/rspec_booster
CHANGED
@@ -2,8 +2,11 @@
|
|
2
2
|
|
3
3
|
require "test_boosters"
|
4
4
|
|
5
|
-
cli_options
|
6
|
-
|
7
|
-
|
5
|
+
cli_options = TestBoosters::CliParser.parse
|
6
|
+
|
7
|
+
thread_index = cli_options[:thread_index] - 1
|
8
|
+
thread_count = cli_options[:thread_count]
|
9
|
+
|
10
|
+
rspec_booster = TestBoosters::Rspec::Booster.new(thread_index, thread_count)
|
8
11
|
|
9
12
|
exit(rspec_booster.run)
|
@@ -6,7 +6,12 @@ module TestBoosters
|
|
6
6
|
options = {}
|
7
7
|
|
8
8
|
parser = OptionParser.new do |opts|
|
9
|
-
opts.on("--thread INDEX")
|
9
|
+
opts.on("--thread INDEX") do |parameter|
|
10
|
+
thread_index, thread_count, _rest = parameter.split("/")
|
11
|
+
|
12
|
+
options[:thread_index] = thread_index.to_i
|
13
|
+
options[:thread_count] = thread_count.to_i
|
14
|
+
end
|
10
15
|
end
|
11
16
|
|
12
17
|
parser.parse!
|
@@ -2,8 +2,12 @@ module TestBoosters
|
|
2
2
|
module Cucumber
|
3
3
|
class Booster
|
4
4
|
|
5
|
-
|
5
|
+
attr_reader :thread_index
|
6
|
+
attr_reader :thread_count
|
7
|
+
|
8
|
+
def initialize(thread_index, thread_count)
|
6
9
|
@thread_index = thread_index
|
10
|
+
@thread_count = thread_count
|
7
11
|
end
|
8
12
|
|
9
13
|
def run
|
@@ -18,12 +22,8 @@ module TestBoosters
|
|
18
22
|
threads[@thread_index].run
|
19
23
|
end
|
20
24
|
|
21
|
-
def thread_count
|
22
|
-
@thread_count ||= split_configuration.thread_count
|
23
|
-
end
|
24
|
-
|
25
25
|
def threads
|
26
|
-
@threads ||= Array.new(thread_count) do |thread_index|
|
26
|
+
@threads ||= Array.new(@thread_count) do |thread_index|
|
27
27
|
known_files = all_specs & split_configuration.files_for_thread(thread_index)
|
28
28
|
leftover_files = TestBoosters::LeftoverFiles.select(all_leftover_specs, thread_count, thread_index)
|
29
29
|
|
@@ -2,8 +2,12 @@ module TestBoosters
|
|
2
2
|
module Rspec
|
3
3
|
class Booster
|
4
4
|
|
5
|
-
|
5
|
+
attr_reader :thread_index
|
6
|
+
attr_reader :thread_count
|
7
|
+
|
8
|
+
def initialize(thread_index, thread_count)
|
6
9
|
@thread_index = thread_index
|
10
|
+
@thread_count = thread_count
|
7
11
|
end
|
8
12
|
|
9
13
|
def run
|
@@ -18,12 +22,8 @@ module TestBoosters
|
|
18
22
|
threads[@thread_index].run
|
19
23
|
end
|
20
24
|
|
21
|
-
def thread_count
|
22
|
-
@thread_count ||= split_configuration.thread_count
|
23
|
-
end
|
24
|
-
|
25
25
|
def threads
|
26
|
-
@threads ||= Array.new(thread_count) do |thread_index|
|
26
|
+
@threads ||= Array.new(@thread_count) do |thread_index|
|
27
27
|
known_files = all_specs & split_configuration.files_for_thread(thread_index)
|
28
28
|
leftover_files = TestBoosters::LeftoverFiles.select(all_leftover_specs, thread_count, thread_index)
|
29
29
|
|