knapsack 1.20.0 → 3.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: 8879f5cca688a2b1aa08c37eba20408ae00387137cb9ba141c144189dac4a75b
4
- data.tar.gz: 4a4cb1f940dd7873d4187d5b1cae1261ca3c849566457d702aa94d9f754908c5
3
+ metadata.gz: bf3e5a9aba000c4d624a76850d39373731918bbdcba5c1627a98131983823ff9
4
+ data.tar.gz: 524c4e365f94683bd571fbd33538aa737df1a4c44a73d66ee64d512097221c84
5
5
  SHA512:
6
- metadata.gz: a9ab9066162444bd414c5cc9d45fbaf80ed91d438d1892064661362fffa60fdf2bcb09124e1a53883b5cd285c1f7c58c233dfb643dce0a2084168e2b2cdf7d8e
7
- data.tar.gz: 67d6820b4c14a418761200069f158068ce74473b366b01d448f4eea5f98118fd8fa484a1f8fcc37480a43ea72c45cdcfb3689cf737e397dab24b77a421208a0d
6
+ metadata.gz: 0a365bc8c5bc58458191e864263184307d2a8c5fb3ecfba965c22e8f78d9a322af4a14b8721456ace7729e4a50c4df2f4788acb84141910202ebf9d6794b7bf9
7
+ data.tar.gz: 82228079c42fb2c423f6085b402c7e014d99f96388b42d0d831e1e03d631bbe56980f9902eb498306a21cb67ae183dceeba43f82e94bc66c4397870ac68aa1bd
@@ -0,0 +1,117 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
17
+ ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', truffleruby-head]
18
+
19
+ steps:
20
+ - uses: actions/checkout@v2
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby }}
25
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
26
+
27
+ # Test for knapsack gem
28
+ - name: Run specs for Knapsack gem
29
+ run: bundle exec rspec spec
30
+
31
+ # Tests for example rspec test suite
32
+ - name: Generate knapsack report
33
+ run: KNAPSACK_GENERATE_REPORT=true bundle exec rspec --default-path spec_examples --tag focus
34
+
35
+ - name: Run specs with enabled time offset warning
36
+ run: bundle exec rspec --default-path spec_examples
37
+
38
+ - name: Run rake task for the first CI node
39
+ run: CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
40
+ - name: Run rake task for the second CI node
41
+ run: CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
42
+
43
+ - name: Check passing arguments to rspec. Run only specs with custom_focus tag (1/2)
44
+ run: KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake "knapsack:rspec[--tag custom_focus]"
45
+ - name: Check passing arguments to rspec. Run only specs with custom_focus tag (2/2)
46
+ run: KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bin/knapsack rspec "--tag custom_focus --profile"
47
+
48
+ - name: Run specs with custom knapsack logger
49
+ run: CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
50
+
51
+ - name: Run specs for custom knapsack report path
52
+ run: |
53
+ cp knapsack_rspec_report.json knapsack_custom_rspec_report.json
54
+ KNAPSACK_REPORT_PATH="knapsack_custom_rspec_report.json" KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
55
+
56
+ - name: Run specs when spec file was removed and still exists in knapsack report json
57
+ run: |
58
+ rm spec_examples/fast/1_spec.rb
59
+ KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
60
+
61
+ - name: Run specs from multiple directories with manually specified test_dir
62
+ run: KNAPSACK_TEST_DIR=spec_examples KNAPSACK_TEST_FILE_PATTERN="{spec_examples,spec_engine_examples}/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
63
+
64
+ # Tests for example minitest test suite
65
+ - name: Generate knapsack report
66
+ run: KNAPSACK_GENERATE_REPORT=true bundle exec rake test
67
+
68
+ - name: Run tests with enabled time offset warning
69
+ run: bundle exec rake test
70
+
71
+ - name: Run rake task for the first CI node
72
+ run: CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
73
+ - name: Run rake task for the second CI node
74
+ run: CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
75
+
76
+ - name: Check passing arguments to minitest. Run verbose tests
77
+ run: |
78
+ KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake "knapsack:minitest[--verbose]"
79
+ KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bin/knapsack minitest "--verbose --pride"
80
+
81
+ - name: Run tests with custom knapsack logger
82
+ run: CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
83
+
84
+ - name: Run tests for custom knapsack report path
85
+ run: |
86
+ cp knapsack_minitest_report.json knapsack_custom_minitest_report.json
87
+ KNAPSACK_REPORT_PATH="knapsack_custom_minitest_report.json" KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
88
+
89
+ - name: Run tests when test file was removed and still exists in knapsack report json
90
+ run: |
91
+ rm test_examples/fast/unit_test.rb
92
+ KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
93
+
94
+ # Tests for example spinach test suite
95
+ - name: Generate knapsack report
96
+ run: KNAPSACK_GENERATE_REPORT=true bundle exec spinach -f spinach_examples
97
+
98
+ - name: Run tests with enabled time offset warning
99
+ run: bundle exec spinach -f spinach_examples
100
+
101
+ - name: Run rake task for the first CI node
102
+ run: CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="spinach_examples/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_examples]"
103
+ - name: Run rake task for the second CI node
104
+ run: CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="spinach_examples/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_examples]"
105
+
106
+ - name: Run tests with custom knapsack logger
107
+ run: CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="spinach_examples/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_examples]"
108
+
109
+ - name: Run tests for custom knapsack report path
110
+ run: |
111
+ cp knapsack_spinach_report.json knapsack_custom_spinach_report.json
112
+ KNAPSACK_REPORT_PATH="knapsack_custom_spinach_report.json" KNAPSACK_TEST_FILE_PATTERN="spinach_examples/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_examples]"
113
+
114
+ - name: Run tests when test file was removed and still exists in knapsack report json
115
+ run: |
116
+ rm spinach_examples/scenario1.feature
117
+ KNAPSACK_TEST_FILE_PATTERN="spinach_examples/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_examples]"
data/CHANGELOG.md CHANGED
@@ -2,29 +2,81 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 3.0.0
6
+
7
+ * __(breaking change)__ Require minimum Ruby 2.2 version
8
+
9
+ https://github.com/KnapsackPro/knapsack/pull/115
10
+
11
+ * __(breaking change)__ Drop support for Minitest 4.x. Force to use minitest 5.x even on CI.
12
+
13
+ https://github.com/KnapsackPro/knapsack/pull/114
14
+
15
+ * Replace Travis CI with GitHub Actions
16
+
17
+ https://github.com/KnapsackPro/knapsack/pull/112
18
+
19
+ https://github.com/KnapsackPro/knapsack/compare/v2.0.0...v3.0.0
20
+
21
+ ### 2.0.0
22
+
23
+ * __(breaking change)__ Ruby 2.1 is a minimum required version
24
+
25
+ https://github.com/KnapsackPro/knapsack/pull/113
26
+
27
+ * Use Ruby 3 and add small development adjustments in codebase
28
+
29
+ https://github.com/KnapsackPro/knapsack/pull/110
30
+
31
+ https://github.com/KnapsackPro/knapsack/compare/v1.22.0...v2.0.0
32
+
33
+ ### 1.22.0
34
+
35
+ * Update time offset warning
36
+
37
+ https://github.com/KnapsackPro/knapsack/pull/105
38
+
39
+ https://github.com/KnapsackPro/knapsack/compare/v1.21.1...v1.22.0
40
+
41
+ ### 1.21.1
42
+
43
+ * Fix a bug with tracking time for pending specs in RSpec
44
+
45
+ https://github.com/KnapsackPro/knapsack/pull/109
46
+
47
+ https://github.com/KnapsackPro/knapsack/compare/v1.21.0...v1.21.1
48
+
49
+ ### 1.21.0
50
+
51
+ * Track time in before and after `:context` hooks
52
+
53
+ https://github.com/KnapsackPro/knapsack/pull/107
54
+
55
+ https://github.com/KnapsackPro/knapsack/compare/v1.20.0...v1.21.0
56
+
5
57
  ### 1.20.0
6
58
 
7
59
  * Use `Process.clock_gettime` to measure track execution time
8
60
 
9
- https://github.com/ArturT/knapsack/pull/100
61
+ https://github.com/KnapsackPro/knapsack/pull/100
10
62
 
11
- https://github.com/ArturT/knapsack/compare/v1.19.0...v1.20.0
63
+ https://github.com/KnapsackPro/knapsack/compare/v1.19.0...v1.20.0
12
64
 
13
65
  ### 1.19.0
14
66
 
15
67
  * Add support for Bitbucket Pipelines
16
68
 
17
- https://github.com/ArturT/knapsack/pull/97
69
+ https://github.com/KnapsackPro/knapsack/pull/97
18
70
 
19
- https://github.com/ArturT/knapsack/compare/v1.18.0...v1.19.0
71
+ https://github.com/KnapsackPro/knapsack/compare/v1.18.0...v1.19.0
20
72
 
21
73
  ### 1.18.0
22
74
 
23
75
  * Add support for Semaphore 2.0
24
76
 
25
- https://github.com/ArturT/knapsack/pull/92
77
+ https://github.com/KnapsackPro/knapsack/pull/92
26
78
 
27
- https://github.com/ArturT/knapsack/compare/v1.17.2...v1.18.0
79
+ https://github.com/KnapsackPro/knapsack/compare/v1.17.2...v1.18.0
28
80
 
29
81
  ### 1.17.2
30
82
 
@@ -33,65 +85,65 @@ https://github.com/ArturT/knapsack/compare/v1.17.2...v1.18.0
33
85
  * Add info about Knapsack Pro Queue Mode in knapsack output
34
86
  * Update URL to FAQ in knapsack output
35
87
 
36
- https://github.com/ArturT/knapsack/pull/90
88
+ https://github.com/KnapsackPro/knapsack/pull/90
37
89
 
38
- https://github.com/ArturT/knapsack/compare/v1.17.1...v1.17.2
90
+ https://github.com/KnapsackPro/knapsack/compare/v1.17.1...v1.17.2
39
91
 
40
92
  ### 1.17.1
41
93
 
42
94
  * Fix RSpec signal handling by replacing process
43
95
 
44
- https://github.com/ArturT/knapsack/pull/86
96
+ https://github.com/KnapsackPro/knapsack/pull/86
45
97
 
46
- https://github.com/ArturT/knapsack/compare/v1.17.0...v1.17.1
98
+ https://github.com/KnapsackPro/knapsack/compare/v1.17.0...v1.17.1
47
99
 
48
100
  ### 1.17.0
49
101
 
50
102
  * Add support for GitLab CI ENV variable `CI_NODE_INDEX` starting from 1.
51
103
 
52
- https://github.com/ArturT/knapsack/pull/83
104
+ https://github.com/KnapsackPro/knapsack/pull/83
53
105
 
54
- https://github.com/ArturT/knapsack/compare/v1.16.0...v1.17.0
106
+ https://github.com/KnapsackPro/knapsack/compare/v1.16.0...v1.17.0
55
107
 
56
108
  ### 1.16.0
57
109
 
58
110
  * Add support for Ruby >= 1.9.3.
59
111
 
60
- https://github.com/ArturT/knapsack/pull/77
112
+ https://github.com/KnapsackPro/knapsack/pull/77
61
113
 
62
- https://github.com/ArturT/knapsack/compare/v1.15.0...v1.16.0
114
+ https://github.com/KnapsackPro/knapsack/compare/v1.15.0...v1.16.0
63
115
 
64
116
  ### 1.15.0
65
117
 
66
118
  * Add support for Cucumber 3.
67
119
 
68
- https://github.com/ArturT/knapsack/pull/68
120
+ https://github.com/KnapsackPro/knapsack/pull/68
69
121
 
70
- https://github.com/ArturT/knapsack/compare/v1.14.1...v1.15.0
122
+ https://github.com/KnapsackPro/knapsack/compare/v1.14.1...v1.15.0
71
123
 
72
124
  ### 1.14.1
73
125
 
74
126
  * Update RSpec timing adapter to be more resilient.
75
127
 
76
- https://github.com/ArturT/knapsack/pull/64
128
+ https://github.com/KnapsackPro/knapsack/pull/64
77
129
 
78
- https://github.com/ArturT/knapsack/compare/v1.14.0...v1.14.1
130
+ https://github.com/KnapsackPro/knapsack/compare/v1.14.0...v1.14.1
79
131
 
80
132
  ### 1.14.0
81
133
 
82
134
  * Moves Timecop to development dependency.
83
135
 
84
- https://github.com/ArturT/knapsack/pull/61
136
+ https://github.com/KnapsackPro/knapsack/pull/61
85
137
 
86
- https://github.com/ArturT/knapsack/compare/v1.13.3...v1.14.0
138
+ https://github.com/KnapsackPro/knapsack/compare/v1.13.3...v1.14.0
87
139
 
88
140
  ### 1.13.3
89
141
 
90
142
  * Fix: Trailing slash should be removed from allocator test_dir.
91
143
 
92
- https://github.com/ArturT/knapsack/issues/57
144
+ https://github.com/KnapsackPro/knapsack/issues/57
93
145
 
94
- https://github.com/ArturT/knapsack/compare/v1.13.2...v1.13.3
146
+ https://github.com/KnapsackPro/knapsack/compare/v1.13.2...v1.13.3
95
147
 
96
148
  ### 1.13.2
97
149
 
@@ -100,78 +152,78 @@ https://github.com/ArturT/knapsack/compare/v1.13.2...v1.13.3
100
152
  Related:
101
153
  https://github.com/KnapsackPro/knapsack_pro-ruby/issues/27
102
154
 
103
- https://github.com/ArturT/knapsack/compare/v1.13.1...v1.13.2
155
+ https://github.com/KnapsackPro/knapsack/compare/v1.13.1...v1.13.2
104
156
 
105
157
  ### 1.13.1
106
158
 
107
159
  * Fix: Get rid of call #zero? method on $?.exitstatus in test runners tasks
108
160
 
109
- https://github.com/ArturT/knapsack/pull/52
161
+ https://github.com/KnapsackPro/knapsack/pull/52
110
162
 
111
- https://github.com/ArturT/knapsack/compare/v1.13.0...v1.13.1
163
+ https://github.com/KnapsackPro/knapsack/compare/v1.13.0...v1.13.1
112
164
 
113
165
  ### 1.13.0
114
166
 
115
167
  * Add KNAPSACK_LOG_LEVEL option
116
168
 
117
- https://github.com/ArturT/knapsack/pull/49
169
+ https://github.com/KnapsackPro/knapsack/pull/49
118
170
 
119
- https://github.com/ArturT/knapsack/compare/v1.12.2...v1.13.0
171
+ https://github.com/KnapsackPro/knapsack/compare/v1.12.2...v1.13.0
120
172
 
121
173
  ### 1.12.2
122
174
 
123
175
  * Fix support for turnip >= 2.x
124
176
 
125
- https://github.com/ArturT/knapsack/pull/47
177
+ https://github.com/KnapsackPro/knapsack/pull/47
126
178
 
127
- https://github.com/ArturT/knapsack/compare/v1.12.1...v1.12.2
179
+ https://github.com/KnapsackPro/knapsack/compare/v1.12.1...v1.12.2
128
180
 
129
181
  ### 1.12.1
130
182
 
131
183
  * Cucumber and Spinach should load files from proper folder in case when you use custom test directory.
132
184
 
133
- https://github.com/ArturT/knapsack/compare/v1.12.0...v1.12.1
185
+ https://github.com/KnapsackPro/knapsack/compare/v1.12.0...v1.12.1
134
186
 
135
187
  ### 1.12.0
136
188
 
137
189
  * Add support for Minitest::SharedExamples
138
190
 
139
- https://github.com/ArturT/knapsack/pull/46
191
+ https://github.com/KnapsackPro/knapsack/pull/46
140
192
 
141
- https://github.com/ArturT/knapsack/compare/v1.11.1...v1.12.0
193
+ https://github.com/KnapsackPro/knapsack/compare/v1.11.1...v1.12.0
142
194
 
143
195
  ### 1.11.1
144
196
 
145
197
  * 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
146
198
 
147
199
  Related PR:
148
- https://github.com/ArturT/knapsack/pull/41
200
+ https://github.com/KnapsackPro/knapsack/pull/41
149
201
 
150
- https://github.com/ArturT/knapsack/compare/v1.11.0...v1.11.1
202
+ https://github.com/KnapsackPro/knapsack/compare/v1.11.0...v1.11.1
151
203
 
152
204
  ### 1.11.0
153
205
 
154
206
  * Add support for Spinach
155
207
 
156
- https://github.com/ArturT/knapsack/pull/41
208
+ https://github.com/KnapsackPro/knapsack/pull/41
157
209
 
158
- https://github.com/ArturT/knapsack/compare/v1.10.0...v1.11.0
210
+ https://github.com/KnapsackPro/knapsack/compare/v1.10.0...v1.11.0
159
211
 
160
212
  ### 1.10.0
161
213
 
162
214
  * Log the time offset warning at INFO if time not exceeded
163
215
 
164
- https://github.com/ArturT/knapsack/pull/40
216
+ https://github.com/KnapsackPro/knapsack/pull/40
165
217
 
166
- https://github.com/ArturT/knapsack/compare/v1.9.0...v1.10.0
218
+ https://github.com/KnapsackPro/knapsack/compare/v1.9.0...v1.10.0
167
219
 
168
220
  ### 1.9.0
169
221
 
170
222
  * Use Knapsack.logger for runner output
171
223
 
172
- https://github.com/ArturT/knapsack/pull/39
224
+ https://github.com/KnapsackPro/knapsack/pull/39
173
225
 
174
- https://github.com/ArturT/knapsack/compare/v1.8.0...v1.9.0
226
+ https://github.com/KnapsackPro/knapsack/compare/v1.8.0...v1.9.0
175
227
 
176
228
  ### 1.8.0
177
229
 
@@ -179,15 +231,15 @@ https://github.com/ArturT/knapsack/compare/v1.8.0...v1.9.0
179
231
 
180
232
  https://github.com/KnapsackPro/knapsack_pro-ruby/issues/5
181
233
 
182
- https://github.com/ArturT/knapsack/compare/v1.7.0...v1.8.0
234
+ https://github.com/KnapsackPro/knapsack/compare/v1.7.0...v1.8.0
183
235
 
184
236
  ### 1.7.0
185
237
 
186
238
  * Add ability to run tests from multiple directories
187
239
 
188
- https://github.com/ArturT/knapsack/pull/35
240
+ https://github.com/KnapsackPro/knapsack/pull/35
189
241
 
190
- https://github.com/ArturT/knapsack/compare/v1.6.1...v1.7.0
242
+ https://github.com/KnapsackPro/knapsack/compare/v1.6.1...v1.7.0
191
243
 
192
244
  ### 1.6.1
193
245
 
@@ -195,106 +247,106 @@ https://github.com/ArturT/knapsack/compare/v1.6.1...v1.7.0
195
247
 
196
248
  https://github.com/KnapsackPro/knapsack_pro-ruby/pull/4
197
249
 
198
- https://github.com/ArturT/knapsack/compare/v1.6.0...v1.6.1
250
+ https://github.com/KnapsackPro/knapsack/compare/v1.6.0...v1.6.1
199
251
 
200
252
  ### 1.6.0
201
253
 
202
254
  * Add support for Cucumber 2
203
255
 
204
- https://github.com/ArturT/knapsack/issues/30
256
+ https://github.com/KnapsackPro/knapsack/issues/30
205
257
 
206
- https://github.com/ArturT/knapsack/compare/v1.5.1...v1.6.0
258
+ https://github.com/KnapsackPro/knapsack/compare/v1.5.1...v1.6.0
207
259
 
208
260
  ### 1.5.1
209
261
 
210
262
  * Add link to FAQ at the end of time offset warning
211
263
 
212
- https://github.com/ArturT/knapsack/compare/v1.5.0...v1.5.1
264
+ https://github.com/KnapsackPro/knapsack/compare/v1.5.0...v1.5.1
213
265
 
214
266
  ### 1.5.0
215
267
 
216
268
  * Add support for snap-ci.com
217
269
 
218
- https://github.com/ArturT/knapsack/compare/v1.4.1...v1.5.0
270
+ https://github.com/KnapsackPro/knapsack/compare/v1.4.1...v1.5.0
219
271
 
220
272
  ### 1.4.1
221
273
 
222
- * Update test file pattern in tests also. Related PR https://github.com/ArturT/knapsack/pull/27
274
+ * Update test file pattern in tests also. Related PR https://github.com/KnapsackPro/knapsack/pull/27
223
275
  * Ensure there are no duplicates in leftover tests because of new test file pattern
224
276
 
225
- https://github.com/ArturT/knapsack/compare/v1.4.0...v1.4.1
277
+ https://github.com/KnapsackPro/knapsack/compare/v1.4.0...v1.4.1
226
278
 
227
279
  ### 1.4.0
228
280
 
229
281
  * Rename RspecAdapter to RSpecAdapter so that it is consistent
230
282
 
231
- https://github.com/ArturT/knapsack/pull/28
283
+ https://github.com/KnapsackPro/knapsack/pull/28
232
284
 
233
285
  * Change file path patterns to support 1-level symlinks by default
234
286
 
235
- https://github.com/ArturT/knapsack/pull/27
287
+ https://github.com/KnapsackPro/knapsack/pull/27
236
288
 
237
- https://github.com/ArturT/knapsack/compare/v1.3.4...v1.4.0
289
+ https://github.com/KnapsackPro/knapsack/compare/v1.3.4...v1.4.0
238
290
 
239
291
  ### 1.3.4
240
292
 
241
293
  * Make knapsack backwards compatible with earlier version of minitest
242
294
 
243
- https://github.com/ArturT/knapsack/pull/26
295
+ https://github.com/KnapsackPro/knapsack/pull/26
244
296
 
245
- https://github.com/ArturT/knapsack/compare/v1.3.3...v1.3.4
297
+ https://github.com/KnapsackPro/knapsack/compare/v1.3.3...v1.3.4
246
298
 
247
299
  ### 1.3.3
248
300
 
249
301
  * Fix wrong dependency for timecop
250
302
 
251
- https://github.com/ArturT/knapsack/compare/v1.3.2...v1.3.3
303
+ https://github.com/KnapsackPro/knapsack/compare/v1.3.2...v1.3.3
252
304
 
253
305
  ### 1.3.2
254
306
 
255
307
  * Use Timecop as dependency and always use Time.now_without_mock_time to avoid problem when someone did stub on Time without using Timecop.
256
308
  * Don't exit on successful RSpec and Cucumber runs
257
309
 
258
- https://github.com/ArturT/knapsack/pull/25
310
+ https://github.com/KnapsackPro/knapsack/pull/25
259
311
 
260
- https://github.com/ArturT/knapsack/compare/v1.3.1...v1.3.2
312
+ https://github.com/KnapsackPro/knapsack/compare/v1.3.1...v1.3.2
261
313
 
262
314
  ### 1.3.1
263
315
 
264
316
  * Treat KNAPSACK_GENERATE_REPORT=false as generate_report -> false
265
317
 
266
- https://github.com/ArturT/knapsack/pull/22
318
+ https://github.com/KnapsackPro/knapsack/pull/22
267
319
 
268
- https://github.com/ArturT/knapsack/compare/v1.3.0...v1.3.1
320
+ https://github.com/KnapsackPro/knapsack/compare/v1.3.0...v1.3.1
269
321
 
270
322
  ### 1.3.0
271
323
 
272
324
  * Add knapsack binary
273
325
 
274
- https://github.com/ArturT/knapsack/pull/21
326
+ https://github.com/KnapsackPro/knapsack/pull/21
275
327
 
276
- https://github.com/ArturT/knapsack/compare/v1.2.1...v1.3.0
328
+ https://github.com/KnapsackPro/knapsack/compare/v1.2.1...v1.3.0
277
329
 
278
330
  ### 1.2.1
279
331
 
280
332
  * Add support for Turnip features
281
333
 
282
- https://github.com/ArturT/knapsack/pull/19
334
+ https://github.com/KnapsackPro/knapsack/pull/19
283
335
 
284
- https://github.com/ArturT/knapsack/compare/v1.2.0...v1.2.1
336
+ https://github.com/KnapsackPro/knapsack/compare/v1.2.0...v1.2.1
285
337
 
286
338
  ### 1.2.0
287
339
 
288
340
  * Add minitest adapter.
289
341
  * Fix bug with missing global time execution when tests took less than second.
290
342
 
291
- https://github.com/ArturT/knapsack/compare/v1.1.1...v1.2.0
343
+ https://github.com/KnapsackPro/knapsack/compare/v1.1.1...v1.2.0
292
344
 
293
345
  ### 1.1.1
294
346
 
295
347
  * Use `system` instead of `exec` in rake tasks so we can return exit code from command.
296
348
 
297
- https://github.com/ArturT/knapsack/compare/v1.1.0...v1.1.1
349
+ https://github.com/KnapsackPro/knapsack/compare/v1.1.0...v1.1.1
298
350
 
299
351
  ### 1.1.0
300
352
 
@@ -304,15 +356,15 @@ https://github.com/ArturT/knapsack/compare/v1.1.0...v1.1.1
304
356
 
305
357
  * Pull request #12 - Raise error when CI_NODE_INDEX >= CI_NODE_TOTAL
306
358
 
307
- https://github.com/ArturT/knapsack/pull/12
359
+ https://github.com/KnapsackPro/knapsack/pull/12
308
360
 
309
361
  ### 1.0.3
310
362
 
311
363
  * Fix bug #11 - Track properly time when using Timecop gem in tests.
312
364
 
313
- https://github.com/ArturT/knapsack/issues/11
365
+ https://github.com/KnapsackPro/knapsack/issues/11
314
366
 
315
- https://github.com/ArturT/knapsack/issues/9
367
+ https://github.com/KnapsackPro/knapsack/issues/9
316
368
 
317
369
  ### 1.0.2
318
370
 
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.2'
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
@@ -23,20 +23,20 @@ module Knapsack
23
23
  def bind_time_tracker
24
24
  ::Minitest::Test.send(:include, BindTimeTrackerMinitestPlugin)
25
25
 
26
- add_post_run_callback do
26
+ Minitest.after_run do
27
27
  Knapsack.logger.info(Presenter.global_time)
28
28
  end
29
29
  end
30
30
 
31
31
  def bind_report_generator
32
- add_post_run_callback do
32
+ Minitest.after_run do
33
33
  Knapsack.report.save
34
34
  Knapsack.logger.info(Presenter.report_details)
35
35
  end
36
36
  end
37
37
 
38
38
  def bind_time_offset_warning
39
- add_post_run_callback do
39
+ Minitest.after_run do
40
40
  Knapsack.logger.log(
41
41
  Presenter.time_offset_log_level,
42
42
  Presenter.time_offset_warning
@@ -64,16 +64,6 @@ module Knapsack
64
64
  # test_path will look like ./test/dir/unit_test.rb
65
65
  test_path
66
66
  end
67
-
68
- private
69
-
70
- def add_post_run_callback(&block)
71
- if Minitest.respond_to?(:after_run)
72
- Minitest.after_run { block.call }
73
- else
74
- Minitest::Unit.after_tests { block.call }
75
- end
76
- end
77
67
  end
78
68
  end
79
69
  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
@@ -1,3 +1,3 @@
1
1
  module Knapsack
2
- VERSION = '1.20.0'
2
+ VERSION = '3.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
@@ -16,10 +16,22 @@ describe FakeCalculator do
16
16
  end
17
17
 
18
18
  it '#add' do
19
- @calc.add(2, 3).must_equal 5
19
+ result = @calc.add(2, 3)
20
+
21
+ if self.respond_to?(:_)
22
+ _(result).must_equal 5
23
+ else
24
+ result.must_equal 5
25
+ end
20
26
  end
21
27
 
22
28
  it '#mal' do
23
- @calc.mal(2, 3).must_equal 6
29
+ result = @calc.mal(2, 3)
30
+
31
+ if self.respond_to?(:_)
32
+ _(result).must_equal 6
33
+ else
34
+ result.must_equal 6
35
+ end
24
36
  end
25
37
  end
@@ -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.20.0
4
+ version: 3.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-11-21 00:00:00.000000000 Z
11
+ date: 2021-06-22 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.
@@ -163,20 +149,18 @@ email:
163
149
  - arturtrzop@gmail.com
164
150
  executables:
165
151
  - knapsack
166
- - print_header.sh
167
152
  extensions: []
168
153
  extra_rdoc_files: []
169
154
  files:
155
+ - ".github/workflows/ruby.yml"
170
156
  - ".gitignore"
171
157
  - ".rspec"
172
- - ".travis.yml"
173
158
  - CHANGELOG.md
174
159
  - Gemfile
175
160
  - LICENSE.txt
176
161
  - README.md
177
162
  - Rakefile
178
163
  - bin/knapsack
179
- - bin/print_header.sh
180
164
  - docs/images/logos/knapsack-@2.png
181
165
  - docs/images/logos/knapsack-big.png
182
166
  - docs/images/logos/knapsack-logo-@2.png
@@ -266,11 +250,11 @@ files:
266
250
  - test_examples/fast/unit_test.rb
267
251
  - test_examples/slow/slow_test.rb
268
252
  - test_examples/test_helper.rb
269
- homepage: https://github.com/ArturT/knapsack
253
+ homepage: https://github.com/KnapsackPro/knapsack
270
254
  licenses:
271
255
  - MIT
272
256
  metadata: {}
273
- post_install_message:
257
+ post_install_message:
274
258
  rdoc_options: []
275
259
  require_paths:
276
260
  - lib
@@ -278,15 +262,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
278
262
  requirements:
279
263
  - - ">="
280
264
  - !ruby/object:Gem::Version
281
- version: 1.9.3
265
+ version: '2.2'
282
266
  required_rubygems_version: !ruby/object:Gem::Requirement
283
267
  requirements:
284
268
  - - ">="
285
269
  - !ruby/object:Gem::Version
286
270
  version: '0'
287
271
  requirements: []
288
- rubygems_version: 3.0.6
289
- signing_key:
272
+ rubygems_version: 3.2.15
273
+ signing_key:
290
274
  specification_version: 4
291
275
  summary: Knapsack splits tests across CI nodes and makes sure that tests will run
292
276
  comparable time on each node.
data/.travis.yml DELETED
@@ -1,116 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- rvm:
5
- - 2.0.0
6
- - 2.1
7
- - 2.2
8
- - 2.3
9
- - 2.4
10
- - 2.5
11
- - 2.6
12
- - 2.7
13
- addons:
14
- code_climate:
15
- repo_token: 38686058eed480dd0fcf8bce9015733e0bae88e44e30f4a1ac63df8aec2f86d8
16
- before_install:
17
- - "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
18
- script:
19
- # Test for knapsack gem
20
- - bin/print_header.sh "Run specs for Knapsack gem"
21
- - bundle exec rspec spec
22
-
23
-
24
- - bin/print_header.sh "------------------------------------------------------"
25
-
26
-
27
- # Tests for example rspec test suite
28
- - bin/print_header.sh "Generate knapsack report"
29
- - KNAPSACK_GENERATE_REPORT=true bundle exec rspec --default-path spec_examples --tag focus
30
-
31
- - bin/print_header.sh "Run specs with enabled time offset warning"
32
- - bundle exec rspec --default-path spec_examples
33
-
34
- - bin/print_header.sh "Run rake task for the first CI node"
35
- - CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
36
- - bin/print_header.sh "Run rake task for the second CI node"
37
- - CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
38
-
39
- - bin/print_header.sh "Check passing arguments to rspec. Run only specs with custom_focus tag"
40
- - KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake "knapsack:rspec[--tag custom_focus]"
41
- - KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bin/knapsack rspec "--tag custom_focus --profile"
42
-
43
- - bin/print_header.sh "Run specs with custom knapsack logger"
44
- - CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
45
-
46
- - bin/print_header.sh "Run specs for custom knapsack report path"
47
- - cp knapsack_rspec_report.json knapsack_custom_rspec_report.json
48
- - KNAPSACK_REPORT_PATH="knapsack_custom_rspec_report.json" KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
49
-
50
- - bin/print_header.sh "Run specs when spec file was removed and still exists in knapsack report json"
51
- - rm spec_examples/fast/1_spec.rb
52
- - KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
53
-
54
- - bin/print_header.sh "Run specs from multiple directories with manually specified test_dir"
55
- - KNAPSACK_TEST_DIR=spec_examples KNAPSACK_TEST_FILE_PATTERN="{spec_examples,spec_engine_examples}/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
56
-
57
-
58
- - bin/print_header.sh "------------------------------------------------------"
59
-
60
-
61
- # Tests for example minitest test suite
62
- - bin/print_header.sh "Generate knapsack report"
63
- - KNAPSACK_GENERATE_REPORT=true bundle exec rake test
64
-
65
- - bin/print_header.sh "Run tests with enabled time offset warning"
66
- - bundle exec rake test
67
-
68
- - bin/print_header.sh "Run rake task for the first CI node"
69
- - CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
70
- - bin/print_header.sh "Run rake task for the second CI node"
71
- - CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
72
-
73
- - bin/print_header.sh "Check passing arguments to minitest. Run verbose tests"
74
- - 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
77
-
78
- - bin/print_header.sh "Run tests with custom knapsack logger"
79
- - CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
80
-
81
- - bin/print_header.sh "Run tests for custom knapsack report path"
82
- - cp knapsack_minitest_report.json knapsack_custom_minitest_report.json
83
- - KNAPSACK_REPORT_PATH="knapsack_custom_minitest_report.json" KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
84
-
85
- - bin/print_header.sh "Run tests when test file was removed and still exists in knapsack report json"
86
- - rm test_examples/fast/unit_test.rb
87
- - KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
88
-
89
-
90
- - bin/print_header.sh "------------------------------------------------------"
91
-
92
-
93
- # Tests for example spinach test suite
94
- - bin/print_header.sh "Generate knapsack report"
95
- - KNAPSACK_GENERATE_REPORT=true bundle exec spinach -f spinach_examples
96
-
97
- - bin/print_header.sh "Run tests with enabled time offset warning"
98
- - bundle exec spinach -f spinach_examples
99
-
100
- - bin/print_header.sh "Run rake task for the first CI node"
101
- - CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="spinach_examples/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_examples]"
102
- - bin/print_header.sh "Run rake task for the second CI node"
103
- - CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="spinach_examples/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_examples]"
104
-
105
- - bin/print_header.sh "Run tests with custom knapsack logger"
106
- - CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="spinach_examples/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_examples]"
107
-
108
- - bin/print_header.sh "Run tests for custom knapsack report path"
109
- - cp knapsack_spinach_report.json knapsack_custom_spinach_report.json
110
- - KNAPSACK_REPORT_PATH="knapsack_custom_spinach_report.json" KNAPSACK_TEST_FILE_PATTERN="spinach_examples/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_examples]"
111
-
112
- - bin/print_header.sh "Run tests when test file was removed and still exists in knapsack report json"
113
- - rm spinach_examples/scenario1.feature
114
- - KNAPSACK_TEST_FILE_PATTERN="spinach_examples/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_examples]"
115
- notifications:
116
- email: false
data/bin/print_header.sh DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
-
3
- echo ==========================================================================================================================
4
- echo $1
5
- echo ==========================================================================================================================