semaphore_test_boosters 2.0.0 → 2.0.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
  SHA1:
3
- metadata.gz: 818fb423cc0dca748176dcc676e1827e76215f86
4
- data.tar.gz: 5829ff0d66e9613f0f9705617604dd7a447670eb
3
+ metadata.gz: 6115ef24f4518bfaaf70e3556e1cbab67c1d8820
4
+ data.tar.gz: 39f69a9a81d2dbd9df0d01c82d3d6daeefd79a28
5
5
  SHA512:
6
- metadata.gz: 104ea0a5bb98c8479fdc8a8d6a1d73b0b5c4f71d851582b33db7176e855bd1f800c508adf3a37438ac0d3b1ad614c182de4bb0e77267fa85d399f9c2ac911637
7
- data.tar.gz: 9029ac6ab8388faa94cb18af5487611e60f9d8c2fd4d4af9b6763e3cd45c4cb2cba704f3596995ce3c0f7702e52cd5b6398b4ea7cddf3f6fe61271cc013e35eb
6
+ metadata.gz: 5f7ac16b098e9f3cd360b8451c35ed460f6b3aa970f3d72d58c23dc62bd9c4828eea35735ce56905e417165aecc562c0181cc14016d9adaee3e6badcc117ac7d
7
+ data.tar.gz: c6d21b3e1db2231740b74c7f2876a3b14c921187340b2e7fc975ea0f885ffc255dda0ef6d4109b4c59a61cded45635f2b9c8a583c642c3253040bd77c488204c
data/README.md CHANGED
@@ -7,49 +7,41 @@ Auto Parallelization — runs test files in multiple jobs
7
7
 
8
8
  - [Installation](#installation)
9
9
 
10
- - RSpec Booster
11
- - [Running RSpec jobs](#rspec-booster)
12
- - [RSpec Split Configuration](#rspec-split-configuration)
13
- - [Leftover RSpec specs](#leftover-rspec-specs)
14
- - [Passing custom options to RSpec](#custom-rspec-options)
15
-
16
- - Cucumber Booster
17
- - [Running Cucumber jobs](#cucumber-booster)
18
- - [Cucumber Split Configuration](#cucumber-split-configuration)
19
- - [Leftover Cucumber specs](#leftover-rspec-specs)
20
- - [Passing custom options to Cucumber](#custom-cucumber-options)
10
+ Test Booster basics:
21
11
 
22
- ## Installation
12
+ - [What are Test Boosters](#what-are-test-boosters)
13
+ - [Split Configuration](#split-configuration)
14
+ - [Leftover Files](#split-configuration)
23
15
 
24
- ``` bash
25
- gem install semaphore_test_boosters
26
- ````
16
+ Test Boosters:
27
17
 
28
- ## RSpec Booster
18
+ - [RSpec Booster](#rspec-booster)
19
+ - [Cucumber Booster](#cucumber-booster)
20
+ - [Minitest Booster](#minitest-booster)
21
+ - [ExUnit Booster](#ex-unit-booster)
22
+ - [GoTest Booster](#go-test-booster)
29
23
 
30
- The RSpec Booster splits your RSpec test suite to multiple jobs.
31
24
 
32
- For example, if you want to split your RSpec test suite into 21 jobs, and run
33
- then executed the 3rd job, use the following command:
25
+ ## Installation
34
26
 
35
27
  ``` bash
36
- rspec_booster --thread 3/21
37
- ```
28
+ gem install semaphore_test_boosters
29
+ ````
38
30
 
39
- By default, RSpec Booster will distribute your spec files based on their size
40
- into multiple jobs. This is OK for your first run, but the distribution is
41
- usually suboptimal.
31
+ ## What are Test Boosters
42
32
 
43
- If you want to achieve better build times, and split your test files more
44
- evenly, you need to provide a split configuration file for RSpec Booster.
33
+ Test Boosters take your test suite and split the test files into multiple jobs.
34
+ This allows you to quickly parallelize your test suite across multiple build
35
+ machines.
45
36
 
46
- On Semaphore, this file is generated before every build based on the duration's
47
- of your previous builds.
37
+ As an example, let's take a look at the `rspec_booster --job 1/10` command. It
38
+ lists all the files that match the `spec/**/*_spec.rb` glob in your project,
39
+ distributes them into 10 jobs, and execute the first job.
48
40
 
49
- ### RSpec Split Configuration
41
+ ### Split Configuration
50
42
 
51
- The `rspec_split_configuration.json` should be placed in your home directory and
52
- should contain the list of files for each RSpec Booster job.
43
+ Every test booster can load a split configuration file that helps the test
44
+ booster to make a better distribution.
53
45
 
54
46
  For example, if you have 3 RSpec Booster jobs, and you want to run:
55
47
 
@@ -67,9 +59,12 @@ you should put the following in your split configuration file:
67
59
  ]
68
60
  ```
69
61
 
70
- ### Leftover RSpec specs
62
+ Semaphore uses Split configurations to split your test files based their
63
+ durations in the previous builds.
71
64
 
72
- Files that are part of your RSpec test suite, but are not in the split
65
+ ### Leftover Files
66
+
67
+ Files that are part of your test suite, but are not in the split
73
68
  configuration file, are called "leftover files". These files will be distributed
74
69
  based on their file size in a round robin fashion across your jobs.
75
70
 
@@ -102,108 +97,108 @@ rspec_booster --job 1/3
102
97
  # => runs: bundle exec rspec spec/a_spec.rb spec/d_spec.rb
103
98
  ```
104
99
 
105
- ### Custom RSpec options
100
+ ## RSpec Booster
106
101
 
107
- By default, `rspec_booster` passes the following options to RSpec:
102
+ The `rspec_booster` loads all the files that match the `spec/**/*_spec.rb`
103
+ pattern and uses the `~/rspec_split_configuration.json` file to parallelize your
104
+ test suite.
105
+
106
+ Example of running job 4 out of 32 jobs:
108
107
 
109
108
  ``` bash
110
- --format documentation --format json --out ~/rspec_report.json
109
+ rspec_booster --job 4/32
111
110
  ```
112
111
 
113
- If you want to pass additional parameters to RSpec, you can do that by setting
114
- the `TB_RSPEC_OPTIONS` environment variable.
112
+ Under the hood, the RSpec Booster uses the following command:
115
113
 
116
- For example, if you want to pass a `--fail-fast` option to RSpec, you can do it
117
- like this:
114
+ ``` bash
115
+ bundle exec rspec --format documentation --format json --out /home/<user>/rspec_report.json <file_list>
116
+ ```
117
+
118
+ Optionally, you can pass additional RSpec flags with the `TB_RSPEC_OPTIONS`
119
+ environment variable:
118
120
 
119
121
  ``` bash
120
- export TB_RSPEC_OPTIONS = '--fail-fast'
122
+ TB_RSPEC_OPTIONS='--fail-fast=3' rspec_booster --job 4/32
123
+ ```
121
124
 
122
- rspec_booster --job 2/3
125
+ The above command will execute:
123
126
 
124
- # => runs: bundle exec rspec --fail-fast --format documentation --format json --out ~/rspec_report.json <file_list>
127
+ ``` bash
128
+ bundle exec rspec --fail-fast=3 --format documentation --format json --out /home/<user>/rspec_report.json <file_list>
125
129
  ```
126
130
 
127
131
  ## Cucumber Booster
128
132
 
129
- The Cucumber Booster splits your Cucumber test suite to multiple jobs.
133
+ The `cucumber_booster` loads all the files that match the `features/**/*.feature`
134
+ pattern and uses the `~/cucumber_split_configuration.json` file to parallelize
135
+ your test suite.
130
136
 
131
- For example, if you want to split your Cucumber test suite into 21 jobs, and run
132
- then executed the 3rd job, use the following command:
137
+ Example of running job 4 out of 32 jobs:
133
138
 
134
139
  ``` bash
135
- cucumber_booster --thread 3/21
140
+ cucumber_booster --job 4/32
136
141
  ```
137
142
 
138
- By default, Cucumber Booster will distribute your spec files based on their size
139
- into multiple jobs. This is OK for your first run, but the distribution is
140
- usually suboptimal.
141
-
142
- If you want to achieve better build times, and split your test files more
143
- evenly, you need to provide a split configuration file for Cucumber Booster.
143
+ Under the hood, the Cucumber Booster uses the following command:
144
144
 
145
- On Semaphore, this file is generated before every build based on the duration's
146
- of your previous builds.
145
+ ``` bash
146
+ bundle exec cucumber <file_list>
147
+ ```
147
148
 
148
- ### Cucumber Split Configuration
149
+ ## Minitest Booster
149
150
 
150
- The `cucumber_split_configuration.json` should be placed in your home directory
151
- and should contain the list of files for each Cucumber Booster job.
151
+ The `minitest_booster` loads all the files that match the `test/**/*_test.rb`
152
+ pattern and uses the `~/minitest_split_configuration.json` file to parallelize
153
+ your test suite.
152
154
 
153
- For example, if you have 3 Cucumber Booster jobs, and you want to run:
155
+ Example of running job 4 out of 32 jobs:
154
156
 
155
- - `features/a.feature` and `spec/b.feature` in the first job
156
- - `features/c.feature` and `spec/d.feature` in the second job
157
- - `features/e.feature` in the third job
157
+ ``` bash
158
+ minitest_booster --job 4/32
159
+ ```
158
160
 
159
- you should put the following in your split configuration file:
161
+ Under the hood, the Minitest Booster uses the following command:
160
162
 
161
- ``` json
162
- [
163
- { "files": ["features/a.feature", "features/b.feature"] },
164
- { "files": ["features/c.feature", "features/d.feature"] },
165
- { "files": ["features/e.feature"] }
166
- ]
163
+ ``` bash
164
+ ruby -e 'ARGV.each { |f| require ".#{f}" }' <file_list>
167
165
  ```
168
166
 
169
- ### Leftover files
167
+ ## ExUnit Booster
170
168
 
171
- Files that are part of your Cucumber test suite, but are not in the split
172
- configuration file, are called "leftover files". These files will be distributed
173
- based on their file size in a round robin fashion across your jobs.
169
+ The `ex_unit_booster` loads all the files that match the `test/**/*_test.exs`
170
+ pattern and uses the `~/ex_unit_split_configuration.json` file to parallelize
171
+ your test suite.
174
172
 
175
- For example, if you have the following in your split configuration:
173
+ Example of running job 4 out of 32 jobs:
176
174
 
177
- ``` json
178
- [
179
- { "files": ["features/a.feature"] }
180
- { "files": ["features/b.feature"] }
181
- { "files": ["features/c.feature"] }
182
- ]
175
+ ``` bash
176
+ ex_unit_booster --job 4/32
183
177
  ```
184
178
 
185
- and the following files in your spec directory:
179
+ Under the hood, the ExUnit Booster uses the following command:
186
180
 
187
181
  ``` bash
188
- features/a.feature
189
- features/b.feature
190
- features/c.feature
191
- features/d.feature
192
- features/e.feature
182
+ mix test <file_list>
193
183
  ```
194
184
 
195
- When you run the `cucumber_booster --job 1/3` command, the files from the
196
- configuration's first job and some leftover files will be executed.
185
+ ## Go Test Booster
197
186
 
198
- ``` bash
199
- cucumber_booster --job 1/3
187
+ The `go_test_booster` loads all the files that match the `**/*_test.go`
188
+ pattern and uses the `~/go_test_split_configuration.json` file to parallelize
189
+ your test suite.
190
+
191
+ Example of running job 4 out of 32 jobs:
200
192
 
201
- # => runs: bundle exec cucumber features/a.feature features/d.feature
193
+ ``` bash
194
+ go_test_booster --job 4/32
202
195
  ```
203
196
 
204
- ### Custom Cucumber options
197
+ Under the hood, the Go Test Booster uses the following command:
205
198
 
206
- Currently, you can't pass custom options to Cucumber.
199
+ ``` bash
200
+ go test <file_list>
201
+ ```
207
202
 
208
203
  ## Contributing
209
204
 
@@ -8,7 +8,7 @@ module TestBoosters
8
8
 
9
9
  puts command unless options[:silent] == true
10
10
 
11
- Bundler.with_clean_env do
11
+ with_clean_env do
12
12
  system(command)
13
13
  end
14
14
 
@@ -19,6 +19,10 @@ module TestBoosters
19
19
  exit_status
20
20
  end
21
21
 
22
+ def with_clean_env
23
+ defined?(Bundler) ? Bundler.with_clean_env { yield } : yield
24
+ end
25
+
22
26
  def display_title(title)
23
27
  puts
24
28
  puts "=== #{title} ===="
@@ -1,3 +1,3 @@
1
1
  module TestBoosters
2
- VERSION = "2.0.0".freeze
2
+ VERSION = "2.0.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semaphore_test_boosters
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Developers at Rendered Text