knapsack 1.19.0 → 2.0.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: 6a50a48925cacc27dbadfc763effe1061eb2dc6dec00217e23e304080e74faee
4
- data.tar.gz: 60b6827c19012025fa3651a6e6017b3351eee25cd76cc5c0795625bd1d6dfe09
3
+ metadata.gz: c222a0243faf064fbe10b0216838707da4fe45bd19800bfa8a3e3b300101a27d
4
+ data.tar.gz: c42d0f4af0a1f78e6371b3c7d784195d7ea00806ff5dcd83c976645a423fdd51
5
5
  SHA512:
6
- metadata.gz: 1ec9fe137cf43655aeab8bf89c969b0969485de1d16ea4de287d3eeb08bfa9b486b3aff58b632241792464f4d175b30d433e4901c51f2cb2cb6b71e730d556b5
7
- data.tar.gz: 94842148dfb9ae8756a127decaabb8bdf0be8d0e3a3b8d708939e46b2ee214c3fef847a82d16562368ff4a0cdcf6cdec7aa7751a4045a69eebaa47c199e5b6e4
6
+ metadata.gz: d21f6ebe5063f1fae3c34ab454007b011722273f9601b50f4d24acd0fbf20ecf198ffb61f25d858503859b33b972f1aa44a28bd57538f79cdf31c968e6ccc81a
7
+ data.tar.gz: 61306d11f78692150774616a577a9b5f42bbafafbdbfca6464c1dae534c8b5c6372910b69c26739763bca8a576f43564e8be7010d315ed6701c0cdc66651ef56
data/.travis.yml CHANGED
@@ -2,7 +2,6 @@
2
2
  sudo: false
3
3
  language: ruby
4
4
  rvm:
5
- - 2.0.0
6
5
  - 2.1
7
6
  - 2.2
8
7
  - 2.3
@@ -10,6 +9,8 @@ rvm:
10
9
  - 2.5
11
10
  - 2.6
12
11
  - 2.7
12
+ - 3.0
13
+ - truffleruby-head
13
14
  addons:
14
15
  code_climate:
15
16
  repo_token: 38686058eed480dd0fcf8bce9015733e0bae88e44e30f4a1ac63df8aec2f86d8
@@ -72,8 +73,7 @@ script:
72
73
 
73
74
  - bin/print_header.sh "Check passing arguments to minitest. Run verbose tests"
74
75
  - KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake "knapsack:minitest[--verbose]"
75
- - if [ "$TRAVIS_RUBY_VERSION" == "1.9.3" ]; then KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bin/knapsack minitest "--verbose"; fi
76
- - if [ "$TRAVIS_RUBY_VERSION" != "1.9.3" ]; then KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bin/knapsack minitest "--verbose --pride"; fi
76
+ - KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bin/knapsack minitest "--verbose --pride"
77
77
 
78
78
  - bin/print_header.sh "Run tests with custom knapsack logger"
79
79
  - CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
data/CHANGELOG.md CHANGED
@@ -2,21 +2,65 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 2.0.0
6
+
7
+ * (breaking change) Ruby 2.1 is a minimum required version
8
+
9
+ https://github.com/KnapsackPro/knapsack/pull/113
10
+
11
+ * Use Ruby 3 and add small development adjustments in codebase
12
+
13
+ https://github.com/KnapsackPro/knapsack/pull/110
14
+
15
+ https://github.com/KnapsackPro/knapsack/compare/v1.22.0...v2.0.0
16
+
17
+ ### 1.22.0
18
+
19
+ * Update time offset warning
20
+
21
+ https://github.com/KnapsackPro/knapsack/pull/105
22
+
23
+ https://github.com/KnapsackPro/knapsack/compare/v1.21.1...v1.22.0
24
+
25
+ ### 1.21.1
26
+
27
+ * Fix a bug with tracking time for pending specs in RSpec
28
+
29
+ https://github.com/KnapsackPro/knapsack/pull/109
30
+
31
+ https://github.com/KnapsackPro/knapsack/compare/v1.21.0...v1.21.1
32
+
33
+ ### 1.21.0
34
+
35
+ * Track time in before and after `:context` hooks
36
+
37
+ https://github.com/KnapsackPro/knapsack/pull/107
38
+
39
+ https://github.com/KnapsackPro/knapsack/compare/v1.20.0...v1.21.0
40
+
41
+ ### 1.20.0
42
+
43
+ * Use `Process.clock_gettime` to measure track execution time
44
+
45
+ https://github.com/KnapsackPro/knapsack/pull/100
46
+
47
+ https://github.com/KnapsackPro/knapsack/compare/v1.19.0...v1.20.0
48
+
5
49
  ### 1.19.0
6
50
 
7
51
  * Add support for Bitbucket Pipelines
8
52
 
9
- https://github.com/ArturT/knapsack/pull/97
53
+ https://github.com/KnapsackPro/knapsack/pull/97
10
54
 
11
- https://github.com/ArturT/knapsack/compare/v1.18.0...v1.19.0
55
+ https://github.com/KnapsackPro/knapsack/compare/v1.18.0...v1.19.0
12
56
 
13
57
  ### 1.18.0
14
58
 
15
59
  * Add support for Semaphore 2.0
16
60
 
17
- https://github.com/ArturT/knapsack/pull/92
61
+ https://github.com/KnapsackPro/knapsack/pull/92
18
62
 
19
- https://github.com/ArturT/knapsack/compare/v1.17.2...v1.18.0
63
+ https://github.com/KnapsackPro/knapsack/compare/v1.17.2...v1.18.0
20
64
 
21
65
  ### 1.17.2
22
66
 
@@ -25,65 +69,65 @@ https://github.com/ArturT/knapsack/compare/v1.17.2...v1.18.0
25
69
  * Add info about Knapsack Pro Queue Mode in knapsack output
26
70
  * Update URL to FAQ in knapsack output
27
71
 
28
- https://github.com/ArturT/knapsack/pull/90
72
+ https://github.com/KnapsackPro/knapsack/pull/90
29
73
 
30
- https://github.com/ArturT/knapsack/compare/v1.17.1...v1.17.2
74
+ https://github.com/KnapsackPro/knapsack/compare/v1.17.1...v1.17.2
31
75
 
32
76
  ### 1.17.1
33
77
 
34
78
  * Fix RSpec signal handling by replacing process
35
79
 
36
- https://github.com/ArturT/knapsack/pull/86
80
+ https://github.com/KnapsackPro/knapsack/pull/86
37
81
 
38
- https://github.com/ArturT/knapsack/compare/v1.17.0...v1.17.1
82
+ https://github.com/KnapsackPro/knapsack/compare/v1.17.0...v1.17.1
39
83
 
40
84
  ### 1.17.0
41
85
 
42
86
  * Add support for GitLab CI ENV variable `CI_NODE_INDEX` starting from 1.
43
87
 
44
- https://github.com/ArturT/knapsack/pull/83
88
+ https://github.com/KnapsackPro/knapsack/pull/83
45
89
 
46
- https://github.com/ArturT/knapsack/compare/v1.16.0...v1.17.0
90
+ https://github.com/KnapsackPro/knapsack/compare/v1.16.0...v1.17.0
47
91
 
48
92
  ### 1.16.0
49
93
 
50
94
  * Add support for Ruby >= 1.9.3.
51
95
 
52
- https://github.com/ArturT/knapsack/pull/77
96
+ https://github.com/KnapsackPro/knapsack/pull/77
53
97
 
54
- https://github.com/ArturT/knapsack/compare/v1.15.0...v1.16.0
98
+ https://github.com/KnapsackPro/knapsack/compare/v1.15.0...v1.16.0
55
99
 
56
100
  ### 1.15.0
57
101
 
58
102
  * Add support for Cucumber 3.
59
103
 
60
- https://github.com/ArturT/knapsack/pull/68
104
+ https://github.com/KnapsackPro/knapsack/pull/68
61
105
 
62
- https://github.com/ArturT/knapsack/compare/v1.14.1...v1.15.0
106
+ https://github.com/KnapsackPro/knapsack/compare/v1.14.1...v1.15.0
63
107
 
64
108
  ### 1.14.1
65
109
 
66
110
  * Update RSpec timing adapter to be more resilient.
67
111
 
68
- https://github.com/ArturT/knapsack/pull/64
112
+ https://github.com/KnapsackPro/knapsack/pull/64
69
113
 
70
- https://github.com/ArturT/knapsack/compare/v1.14.0...v1.14.1
114
+ https://github.com/KnapsackPro/knapsack/compare/v1.14.0...v1.14.1
71
115
 
72
116
  ### 1.14.0
73
117
 
74
118
  * Moves Timecop to development dependency.
75
119
 
76
- https://github.com/ArturT/knapsack/pull/61
120
+ https://github.com/KnapsackPro/knapsack/pull/61
77
121
 
78
- https://github.com/ArturT/knapsack/compare/v1.13.3...v1.14.0
122
+ https://github.com/KnapsackPro/knapsack/compare/v1.13.3...v1.14.0
79
123
 
80
124
  ### 1.13.3
81
125
 
82
126
  * Fix: Trailing slash should be removed from allocator test_dir.
83
127
 
84
- https://github.com/ArturT/knapsack/issues/57
128
+ https://github.com/KnapsackPro/knapsack/issues/57
85
129
 
86
- https://github.com/ArturT/knapsack/compare/v1.13.2...v1.13.3
130
+ https://github.com/KnapsackPro/knapsack/compare/v1.13.2...v1.13.3
87
131
 
88
132
  ### 1.13.2
89
133
 
@@ -92,78 +136,78 @@ https://github.com/ArturT/knapsack/compare/v1.13.2...v1.13.3
92
136
  Related:
93
137
  https://github.com/KnapsackPro/knapsack_pro-ruby/issues/27
94
138
 
95
- https://github.com/ArturT/knapsack/compare/v1.13.1...v1.13.2
139
+ https://github.com/KnapsackPro/knapsack/compare/v1.13.1...v1.13.2
96
140
 
97
141
  ### 1.13.1
98
142
 
99
143
  * Fix: Get rid of call #zero? method on $?.exitstatus in test runners tasks
100
144
 
101
- https://github.com/ArturT/knapsack/pull/52
145
+ https://github.com/KnapsackPro/knapsack/pull/52
102
146
 
103
- https://github.com/ArturT/knapsack/compare/v1.13.0...v1.13.1
147
+ https://github.com/KnapsackPro/knapsack/compare/v1.13.0...v1.13.1
104
148
 
105
149
  ### 1.13.0
106
150
 
107
151
  * Add KNAPSACK_LOG_LEVEL option
108
152
 
109
- https://github.com/ArturT/knapsack/pull/49
153
+ https://github.com/KnapsackPro/knapsack/pull/49
110
154
 
111
- https://github.com/ArturT/knapsack/compare/v1.12.2...v1.13.0
155
+ https://github.com/KnapsackPro/knapsack/compare/v1.12.2...v1.13.0
112
156
 
113
157
  ### 1.12.2
114
158
 
115
159
  * Fix support for turnip >= 2.x
116
160
 
117
- https://github.com/ArturT/knapsack/pull/47
161
+ https://github.com/KnapsackPro/knapsack/pull/47
118
162
 
119
- https://github.com/ArturT/knapsack/compare/v1.12.1...v1.12.2
163
+ https://github.com/KnapsackPro/knapsack/compare/v1.12.1...v1.12.2
120
164
 
121
165
  ### 1.12.1
122
166
 
123
167
  * Cucumber and Spinach should load files from proper folder in case when you use custom test directory.
124
168
 
125
- https://github.com/ArturT/knapsack/compare/v1.12.0...v1.12.1
169
+ https://github.com/KnapsackPro/knapsack/compare/v1.12.0...v1.12.1
126
170
 
127
171
  ### 1.12.0
128
172
 
129
173
  * Add support for Minitest::SharedExamples
130
174
 
131
- https://github.com/ArturT/knapsack/pull/46
175
+ https://github.com/KnapsackPro/knapsack/pull/46
132
176
 
133
- https://github.com/ArturT/knapsack/compare/v1.11.1...v1.12.0
177
+ https://github.com/KnapsackPro/knapsack/compare/v1.11.1...v1.12.0
134
178
 
135
179
  ### 1.11.1
136
180
 
137
181
  * Require spinach in spec helper so tests will pass but don't require it in spinach adapter because it breaks for users who don't use spinach and they don't want to add it to their Gemfile
138
182
 
139
183
  Related PR:
140
- https://github.com/ArturT/knapsack/pull/41
184
+ https://github.com/KnapsackPro/knapsack/pull/41
141
185
 
142
- https://github.com/ArturT/knapsack/compare/v1.11.0...v1.11.1
186
+ https://github.com/KnapsackPro/knapsack/compare/v1.11.0...v1.11.1
143
187
 
144
188
  ### 1.11.0
145
189
 
146
190
  * Add support for Spinach
147
191
 
148
- https://github.com/ArturT/knapsack/pull/41
192
+ https://github.com/KnapsackPro/knapsack/pull/41
149
193
 
150
- https://github.com/ArturT/knapsack/compare/v1.10.0...v1.11.0
194
+ https://github.com/KnapsackPro/knapsack/compare/v1.10.0...v1.11.0
151
195
 
152
196
  ### 1.10.0
153
197
 
154
198
  * Log the time offset warning at INFO if time not exceeded
155
199
 
156
- https://github.com/ArturT/knapsack/pull/40
200
+ https://github.com/KnapsackPro/knapsack/pull/40
157
201
 
158
- https://github.com/ArturT/knapsack/compare/v1.9.0...v1.10.0
202
+ https://github.com/KnapsackPro/knapsack/compare/v1.9.0...v1.10.0
159
203
 
160
204
  ### 1.9.0
161
205
 
162
206
  * Use Knapsack.logger for runner output
163
207
 
164
- https://github.com/ArturT/knapsack/pull/39
208
+ https://github.com/KnapsackPro/knapsack/pull/39
165
209
 
166
- https://github.com/ArturT/knapsack/compare/v1.8.0...v1.9.0
210
+ https://github.com/KnapsackPro/knapsack/compare/v1.8.0...v1.9.0
167
211
 
168
212
  ### 1.8.0
169
213
 
@@ -171,15 +215,15 @@ https://github.com/ArturT/knapsack/compare/v1.8.0...v1.9.0
171
215
 
172
216
  https://github.com/KnapsackPro/knapsack_pro-ruby/issues/5
173
217
 
174
- https://github.com/ArturT/knapsack/compare/v1.7.0...v1.8.0
218
+ https://github.com/KnapsackPro/knapsack/compare/v1.7.0...v1.8.0
175
219
 
176
220
  ### 1.7.0
177
221
 
178
222
  * Add ability to run tests from multiple directories
179
223
 
180
- https://github.com/ArturT/knapsack/pull/35
224
+ https://github.com/KnapsackPro/knapsack/pull/35
181
225
 
182
- https://github.com/ArturT/knapsack/compare/v1.6.1...v1.7.0
226
+ https://github.com/KnapsackPro/knapsack/compare/v1.6.1...v1.7.0
183
227
 
184
228
  ### 1.6.1
185
229
 
@@ -187,106 +231,106 @@ https://github.com/ArturT/knapsack/compare/v1.6.1...v1.7.0
187
231
 
188
232
  https://github.com/KnapsackPro/knapsack_pro-ruby/pull/4
189
233
 
190
- https://github.com/ArturT/knapsack/compare/v1.6.0...v1.6.1
234
+ https://github.com/KnapsackPro/knapsack/compare/v1.6.0...v1.6.1
191
235
 
192
236
  ### 1.6.0
193
237
 
194
238
  * Add support for Cucumber 2
195
239
 
196
- https://github.com/ArturT/knapsack/issues/30
240
+ https://github.com/KnapsackPro/knapsack/issues/30
197
241
 
198
- https://github.com/ArturT/knapsack/compare/v1.5.1...v1.6.0
242
+ https://github.com/KnapsackPro/knapsack/compare/v1.5.1...v1.6.0
199
243
 
200
244
  ### 1.5.1
201
245
 
202
246
  * Add link to FAQ at the end of time offset warning
203
247
 
204
- https://github.com/ArturT/knapsack/compare/v1.5.0...v1.5.1
248
+ https://github.com/KnapsackPro/knapsack/compare/v1.5.0...v1.5.1
205
249
 
206
250
  ### 1.5.0
207
251
 
208
252
  * Add support for snap-ci.com
209
253
 
210
- https://github.com/ArturT/knapsack/compare/v1.4.1...v1.5.0
254
+ https://github.com/KnapsackPro/knapsack/compare/v1.4.1...v1.5.0
211
255
 
212
256
  ### 1.4.1
213
257
 
214
- * Update test file pattern in tests also. Related PR https://github.com/ArturT/knapsack/pull/27
258
+ * Update test file pattern in tests also. Related PR https://github.com/KnapsackPro/knapsack/pull/27
215
259
  * Ensure there are no duplicates in leftover tests because of new test file pattern
216
260
 
217
- https://github.com/ArturT/knapsack/compare/v1.4.0...v1.4.1
261
+ https://github.com/KnapsackPro/knapsack/compare/v1.4.0...v1.4.1
218
262
 
219
263
  ### 1.4.0
220
264
 
221
265
  * Rename RspecAdapter to RSpecAdapter so that it is consistent
222
266
 
223
- https://github.com/ArturT/knapsack/pull/28
267
+ https://github.com/KnapsackPro/knapsack/pull/28
224
268
 
225
269
  * Change file path patterns to support 1-level symlinks by default
226
270
 
227
- https://github.com/ArturT/knapsack/pull/27
271
+ https://github.com/KnapsackPro/knapsack/pull/27
228
272
 
229
- https://github.com/ArturT/knapsack/compare/v1.3.4...v1.4.0
273
+ https://github.com/KnapsackPro/knapsack/compare/v1.3.4...v1.4.0
230
274
 
231
275
  ### 1.3.4
232
276
 
233
277
  * Make knapsack backwards compatible with earlier version of minitest
234
278
 
235
- https://github.com/ArturT/knapsack/pull/26
279
+ https://github.com/KnapsackPro/knapsack/pull/26
236
280
 
237
- https://github.com/ArturT/knapsack/compare/v1.3.3...v1.3.4
281
+ https://github.com/KnapsackPro/knapsack/compare/v1.3.3...v1.3.4
238
282
 
239
283
  ### 1.3.3
240
284
 
241
285
  * Fix wrong dependency for timecop
242
286
 
243
- https://github.com/ArturT/knapsack/compare/v1.3.2...v1.3.3
287
+ https://github.com/KnapsackPro/knapsack/compare/v1.3.2...v1.3.3
244
288
 
245
289
  ### 1.3.2
246
290
 
247
291
  * Use Timecop as dependency and always use Time.now_without_mock_time to avoid problem when someone did stub on Time without using Timecop.
248
292
  * Don't exit on successful RSpec and Cucumber runs
249
293
 
250
- https://github.com/ArturT/knapsack/pull/25
294
+ https://github.com/KnapsackPro/knapsack/pull/25
251
295
 
252
- https://github.com/ArturT/knapsack/compare/v1.3.1...v1.3.2
296
+ https://github.com/KnapsackPro/knapsack/compare/v1.3.1...v1.3.2
253
297
 
254
298
  ### 1.3.1
255
299
 
256
300
  * Treat KNAPSACK_GENERATE_REPORT=false as generate_report -> false
257
301
 
258
- https://github.com/ArturT/knapsack/pull/22
302
+ https://github.com/KnapsackPro/knapsack/pull/22
259
303
 
260
- https://github.com/ArturT/knapsack/compare/v1.3.0...v1.3.1
304
+ https://github.com/KnapsackPro/knapsack/compare/v1.3.0...v1.3.1
261
305
 
262
306
  ### 1.3.0
263
307
 
264
308
  * Add knapsack binary
265
309
 
266
- https://github.com/ArturT/knapsack/pull/21
310
+ https://github.com/KnapsackPro/knapsack/pull/21
267
311
 
268
- https://github.com/ArturT/knapsack/compare/v1.2.1...v1.3.0
312
+ https://github.com/KnapsackPro/knapsack/compare/v1.2.1...v1.3.0
269
313
 
270
314
  ### 1.2.1
271
315
 
272
316
  * Add support for Turnip features
273
317
 
274
- https://github.com/ArturT/knapsack/pull/19
318
+ https://github.com/KnapsackPro/knapsack/pull/19
275
319
 
276
- https://github.com/ArturT/knapsack/compare/v1.2.0...v1.2.1
320
+ https://github.com/KnapsackPro/knapsack/compare/v1.2.0...v1.2.1
277
321
 
278
322
  ### 1.2.0
279
323
 
280
324
  * Add minitest adapter.
281
325
  * Fix bug with missing global time execution when tests took less than second.
282
326
 
283
- https://github.com/ArturT/knapsack/compare/v1.1.1...v1.2.0
327
+ https://github.com/KnapsackPro/knapsack/compare/v1.1.1...v1.2.0
284
328
 
285
329
  ### 1.1.1
286
330
 
287
331
  * Use `system` instead of `exec` in rake tasks so we can return exit code from command.
288
332
 
289
- https://github.com/ArturT/knapsack/compare/v1.1.0...v1.1.1
333
+ https://github.com/KnapsackPro/knapsack/compare/v1.1.0...v1.1.1
290
334
 
291
335
  ### 1.1.0
292
336
 
@@ -296,15 +340,15 @@ https://github.com/ArturT/knapsack/compare/v1.1.0...v1.1.1
296
340
 
297
341
  * Pull request #12 - Raise error when CI_NODE_INDEX >= CI_NODE_TOTAL
298
342
 
299
- https://github.com/ArturT/knapsack/pull/12
343
+ https://github.com/KnapsackPro/knapsack/pull/12
300
344
 
301
345
  ### 1.0.3
302
346
 
303
347
  * Fix bug #11 - Track properly time when using Timecop gem in tests.
304
348
 
305
- https://github.com/ArturT/knapsack/issues/11
349
+ https://github.com/KnapsackPro/knapsack/issues/11
306
350
 
307
- https://github.com/ArturT/knapsack/issues/9
351
+ https://github.com/KnapsackPro/knapsack/issues/9
308
352
 
309
353
  ### 1.0.2
310
354
 
data/knapsack.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["arturtrzop@gmail.com"]
11
11
  spec.summary = %q{Knapsack splits tests across CI nodes and makes sure that tests will run comparable time on each node.}
12
12
  spec.description = %q{Parallel tests across CI server nodes based on each test file's time execution. It generates a test time execution report and uses it for future test runs.}
13
- spec.homepage = "https://github.com/ArturT/knapsack"
13
+ spec.homepage = "https://github.com/KnapsackPro/knapsack"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -18,17 +18,16 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.required_ruby_version = '>= 1.9.3'
21
+ spec.required_ruby_version = '>= 2.1'
22
22
 
23
23
  spec.add_dependency 'rake', '>= 0'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '>= 1.6'
26
26
  spec.add_development_dependency 'rspec', '~> 3.0', '>= 2.10.0'
27
- spec.add_development_dependency 'rspec-its', '~> 1.2'
27
+ spec.add_development_dependency 'rspec-its', '~> 1.3'
28
28
  spec.add_development_dependency 'cucumber', '>= 0'
29
29
  spec.add_development_dependency 'spinach', '>= 0.8'
30
30
  spec.add_development_dependency 'minitest', '>= 5.0.0'
31
- spec.add_development_dependency 'codeclimate-test-reporter', '~> 0'
32
31
  spec.add_development_dependency 'pry', '~> 0'
33
- spec.add_development_dependency 'timecop', '>= 0.1.0'
32
+ spec.add_development_dependency 'timecop', '>= 0.9.4'
34
33
  end
@@ -6,6 +6,10 @@ module Knapsack
6
6
 
7
7
  def bind_time_tracker
8
8
  ::RSpec.configure do |config|
9
+ config.prepend_before(:context) do
10
+ Knapsack.tracker.start_timer
11
+ end
12
+
9
13
  config.prepend_before(:each) do
10
14
  current_example_group =
11
15
  if ::RSpec.respond_to?(:current_example)
@@ -14,10 +18,9 @@ module Knapsack
14
18
  example.metadata
15
19
  end
16
20
  Knapsack.tracker.test_path = RSpecAdapter.test_path(current_example_group)
17
- Knapsack.tracker.start_timer
18
21
  end
19
22
 
20
- config.append_after(:each) do
23
+ config.append_after(:context) do
21
24
  Knapsack.tracker.stop_timer
22
25
  end
23
26
 
@@ -51,10 +51,14 @@ module Knapsack
51
51
  }
52
52
  if Knapsack.tracker.time_exceeded?
53
53
  str << %{
54
- Tests on this CI node took more than max allowed node time execution.
54
+ Test on this CI node ran for longer than the max allowed node time execution.
55
55
  Please regenerate your knapsack report.
56
- If that didn't help then split your heavy test file
57
- or bump time_offset_in_seconds setting.}
56
+
57
+ If that doesn't help, you can split your slowest test files into smaller files, or bump up the time_offset_in_seconds setting.
58
+
59
+ You can also allow the knapsack_pro gem to automatically divide your slow test files across parallel CI nodes.
60
+ https://knapsackpro.com/faq/question/how-to-auto-split-test-files-by-test-cases-on-parallel-jobs-ci-nodes?utm_source=knapsack_gem&utm_medium=knapsack_gem_output&utm_campaign=knapsack_gem_time_offset_warning
61
+ }
58
62
  else
59
63
  str << %{
60
64
  Global time execution for this CI node is fine.
@@ -63,9 +67,8 @@ Happy testing!}
63
67
  str << "\n\nNeed explanation? See FAQ:"
64
68
  str << "\nhttps://docs.knapsackpro.com/ruby/knapsack#faq"
65
69
  str << "\n=================================================\n"
66
- str << %{See how to split tests in a dynamic way using Queue Mode to ensure all parallel nodes
67
- finish work at a similar time even when your CI or random test execution is a bottleneck:
68
- https://youtu.be/hUEB1XDKEFY
70
+ str << %{Read up on the benefits of a dynamic test split with Knapsack Pro Queue Mode:
71
+ https://docs.knapsackpro.com/2020/how-to-speed-up-ruby-and-javascript-tests-with-ci-parallelisation
69
72
 
70
73
  Sign up for Knapsack Pro here:
71
74
  https://knapsackpro.com}
@@ -23,15 +23,19 @@ module Knapsack
23
23
  end
24
24
 
25
25
  def stop_timer
26
- @execution_time = now_without_mock_time.to_f - @start_time
27
- update_global_time
28
- update_test_file_time
29
- @execution_time
26
+ execution_time = now_without_mock_time.to_f - @start_time
27
+
28
+ if test_path
29
+ update_global_time(execution_time)
30
+ update_test_file_time(execution_time)
31
+ @test_path = nil
32
+ end
33
+
34
+ execution_time
30
35
  end
31
36
 
32
37
  def test_path
33
- raise("test_path needs to be set by Knapsack Adapter's bind method") unless @test_path
34
- @test_path.sub(/^\.\//, '')
38
+ @test_path.sub(/^\.\//, '') if @test_path
35
39
  end
36
40
 
37
41
  def time_exceeded?
@@ -62,13 +66,13 @@ module Knapsack
62
66
  @test_path = nil
63
67
  end
64
68
 
65
- def update_global_time
66
- @global_time += @execution_time
69
+ def update_global_time(execution_time)
70
+ @global_time += execution_time
67
71
  end
68
72
 
69
- def update_test_file_time
73
+ def update_test_file_time(execution_time)
70
74
  @test_files_with_time[test_path] ||= 0
71
- @test_files_with_time[test_path] += @execution_time
75
+ @test_files_with_time[test_path] += execution_time
72
76
  end
73
77
 
74
78
  def report_distributor
@@ -81,11 +85,7 @@ module Knapsack
81
85
  end
82
86
 
83
87
  def now_without_mock_time
84
- if defined?(Timecop)
85
- Time.now_without_mock_time
86
- else
87
- Time.raw_now
88
- end
88
+ Process.clock_gettime(Process::CLOCK_MONOTONIC)
89
89
  end
90
90
  end
91
91
  end
@@ -1,3 +1,3 @@
1
1
  module Knapsack
2
- VERSION = '1.19.0'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -24,8 +24,9 @@ describe Knapsack::Adapters::RSpecAdapter do
24
24
  end
25
25
 
26
26
  it do
27
+ expect(config).to receive(:prepend_before).with(:context).and_yield
27
28
  expect(config).to receive(:prepend_before).with(:each).and_yield
28
- expect(config).to receive(:append_after).with(:each).and_yield
29
+ expect(config).to receive(:append_after).with(:context).and_yield
29
30
  expect(config).to receive(:after).with(:suite).and_yield
30
31
  expect(::RSpec).to receive(:configure).and_yield(config)
31
32
 
@@ -33,10 +34,9 @@ describe Knapsack::Adapters::RSpecAdapter do
33
34
  expect(described_class).to receive(:test_path).with(example_group).and_return(test_path)
34
35
 
35
36
  allow(Knapsack).to receive(:tracker).and_return(tracker)
36
- expect(tracker).to receive(:test_path=).with(test_path)
37
- expect(tracker).to receive(:start_timer)
38
-
39
- expect(tracker).to receive(:stop_timer)
37
+ expect(tracker).to receive(:start_timer).ordered
38
+ expect(tracker).to receive(:test_path=).with(test_path).ordered
39
+ expect(tracker).to receive(:stop_timer).ordered
40
40
 
41
41
  expect(Knapsack::Presenter).to receive(:global_time).and_return(global_time)
42
42
  expect(logger).to receive(:info).with(global_time)
@@ -48,7 +48,7 @@ describe Knapsack::Tracker do
48
48
 
49
49
  context 'when test_path not set' do
50
50
  it do
51
- expect { subject }.to raise_error("test_path needs to be set by Knapsack Adapter's bind method")
51
+ expect(subject).to be_nil
52
52
  end
53
53
  end
54
54
 
@@ -133,6 +133,9 @@ describe Knapsack::Tracker do
133
133
  it { expect(tracker.test_files_with_time.keys.size).to eql 2 }
134
134
  it { expect(tracker.test_files_with_time['a_spec.rb']).to be_within(delta).of(0.1) }
135
135
  it { expect(tracker.test_files_with_time['b_spec.rb']).to be_within(delta).of(0.2) }
136
+ it 'resets test_path after time is measured' do
137
+ expect(tracker.test_path).to be_nil
138
+ end
136
139
  end
137
140
 
138
141
  context "with Timecop - Timecop shouldn't have impact on measured test time" do
@@ -157,6 +160,9 @@ describe Knapsack::Tracker do
157
160
  it { expect(tracker.test_files_with_time.keys.size).to eql 2 }
158
161
  it { expect(tracker.test_files_with_time['a_spec.rb']).to be_within(delta).of(0) }
159
162
  it { expect(tracker.test_files_with_time['b_spec.rb']).to be_within(delta).of(0) }
163
+ it 'resets test_path after time is measured' do
164
+ expect(tracker.test_path).to be_nil
165
+ end
160
166
  end
161
167
  end
162
168
 
data/spec/spec_helper.rb CHANGED
@@ -4,9 +4,6 @@ require 'spinach'
4
4
  require 'timecop'
5
5
  Timecop.safe_mode = true
6
6
 
7
- require 'codeclimate-test-reporter'
8
- CodeClimate::TestReporter.start
9
-
10
7
  require 'knapsack'
11
8
 
12
9
  Dir["#{Knapsack.root}/spec/support/**/*.rb"].each { |f| require f }
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class Minitest::SharedExamples < Module
4
- include Minitest::Spec::DSL if RUBY_VERSION != "1.9.3"
4
+ include Minitest::Spec::DSL
5
5
  end
6
6
 
7
7
  SharedExampleSpec = Minitest::SharedExamples.new do
@@ -2,15 +2,6 @@ require 'minitest/autorun'
2
2
 
3
3
  require 'knapsack'
4
4
 
5
- if RUBY_VERSION == "1.9.3"
6
- unless defined? Minitest
7
- Minitest = MiniTest
8
- end
9
- unless defined? Minitest::Test
10
- Minitest::Test = MiniTest::Unit::TestCase
11
- end
12
- end
13
-
14
5
  Knapsack.tracker.config({
15
6
  enable_time_offset_warning: true,
16
7
  time_offset_in_seconds: 3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-30 00:00:00.000000000 Z
11
+ date: 2021-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -42,36 +42,36 @@ dependencies:
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 2.10.0
48
45
  - - "~>"
49
46
  - !ruby/object:Gem::Version
50
47
  version: '3.0'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 2.10.0
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: 2.10.0
58
55
  - - "~>"
59
56
  - !ruby/object:Gem::Version
60
57
  version: '3.0'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 2.10.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rspec-its
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '1.2'
67
+ version: '1.3'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '1.2'
74
+ version: '1.3'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: cucumber
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -114,20 +114,6 @@ dependencies:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: 5.0.0
117
- - !ruby/object:Gem::Dependency
118
- name: codeclimate-test-reporter
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: '0'
131
117
  - !ruby/object:Gem::Dependency
132
118
  name: pry
133
119
  requirement: !ruby/object:Gem::Requirement
@@ -148,14 +134,14 @@ dependencies:
148
134
  requirements:
149
135
  - - ">="
150
136
  - !ruby/object:Gem::Version
151
- version: 0.1.0
137
+ version: 0.9.4
152
138
  type: :development
153
139
  prerelease: false
154
140
  version_requirements: !ruby/object:Gem::Requirement
155
141
  requirements:
156
142
  - - ">="
157
143
  - !ruby/object:Gem::Version
158
- version: 0.1.0
144
+ version: 0.9.4
159
145
  description: Parallel tests across CI server nodes based on each test file's time
160
146
  execution. It generates a test time execution report and uses it for future test
161
147
  runs.
@@ -266,11 +252,11 @@ files:
266
252
  - test_examples/fast/unit_test.rb
267
253
  - test_examples/slow/slow_test.rb
268
254
  - test_examples/test_helper.rb
269
- homepage: https://github.com/ArturT/knapsack
255
+ homepage: https://github.com/KnapsackPro/knapsack
270
256
  licenses:
271
257
  - MIT
272
258
  metadata: {}
273
- post_install_message:
259
+ post_install_message:
274
260
  rdoc_options: []
275
261
  require_paths:
276
262
  - lib
@@ -278,15 +264,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
278
264
  requirements:
279
265
  - - ">="
280
266
  - !ruby/object:Gem::Version
281
- version: 1.9.3
267
+ version: '2.1'
282
268
  required_rubygems_version: !ruby/object:Gem::Requirement
283
269
  requirements:
284
270
  - - ">="
285
271
  - !ruby/object:Gem::Version
286
272
  version: '0'
287
273
  requirements: []
288
- rubygems_version: 3.0.6
289
- signing_key:
274
+ rubygems_version: 3.2.15
275
+ signing_key:
290
276
  specification_version: 4
291
277
  summary: Knapsack splits tests across CI nodes and makes sure that tests will run
292
278
  comparable time on each node.