knapsack_pro 1.2.0 → 1.2.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
  SHA256:
3
- metadata.gz: 71348dc37d5dee552caf5ccb37c7cedb48dd3f51e5f45ba00e96ccc63e894a87
4
- data.tar.gz: 1bba20bcf45f0baf139f6aa4e0f0454bbf92dce045ce2285491717a8f2e395c6
3
+ metadata.gz: 887d94f1fe7361816cb0ac93c60b82e2ad85d6564ba42c4045024018be9f5c10
4
+ data.tar.gz: 50d568f984f87ac6ba824544f96c579d9ea7a49592fd92838faad77418c85384
5
5
  SHA512:
6
- metadata.gz: 03100f82dcd86e6f352b452d7a99aa5834e8880325512e7d3fb6644d0d7d9077266188e5d10b86117a3516b2979e127873f5b06dab98b4c9cd793665bc93de95
7
- data.tar.gz: 94972e32887092d86ee031726c510fb0382fc6ba8da23edf131b8539d827e9c5b57cb6814d3024814816bd82f1738770ee88a7ce46c15c189a88b0ff6508f52c
6
+ metadata.gz: 59731658ea95a807af73b3ddcdb4f183593e98e825e2705287f784208668cd7ad14423f0e2ca5edd720eaef7766d7c26ea15e8a3bea13fb111f79f90acac607f
7
+ data.tar.gz: bb9721dfdb287a6a8566e0dd72ef4f0f7216915952bd7dd4386560b3b4b81ada0a9176cdde8a42938b4b9be6aa79c01f0796d66a42f42b35126550f564149bac
@@ -2,6 +2,14 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 1.2.1
6
+
7
+ * Run Fallback Mode for exception `Errno::EPIPE`
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/75
10
+
11
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v1.2.0...v1.2.1
12
+
5
13
  ### 1.2.0
6
14
 
7
15
  * Add support for GitLab CI env vars CI_NODE_TOTAL and CI_NODE_INDEX.
data/README.md CHANGED
@@ -102,7 +102,7 @@ The knapsack_pro has also [queue mode](#queue-mode) to get an optimal test suite
102
102
  - [Info for Travis users](#info-for-travis-users)
103
103
  - [Info for semaphoreapp.com users](#info-for-semaphoreappcom-users)
104
104
  - [Info for buildkite.com users](#info-for-buildkitecom-users)
105
- - [Info for Gitlab CI users](#info-for-gitlab-ci-users)
105
+ - [Info for GitLab CI users](#info-for-gitlab-ci-users)
106
106
  - [GitLab CI `>= 11.5`](#gitlab-ci--115)
107
107
  - [GitLab CI `< 11.5` (old GitLab CI)](#gitlab-ci--115-old-gitlab-ci)
108
108
  - [Info for codeship.com users](#info-for-codeshipcom-users)
@@ -118,9 +118,11 @@ The knapsack_pro has also [queue mode](#queue-mode) to get an optimal test suite
118
118
  - [Why I see `LoadError: cannot load such file -- spec_helper`?](#why-i-see-loaderror-cannot-load-such-file----spec_helper)
119
119
  - [Why my CI build fails when I use Test::Unit even when all tests passed?](#why-my-ci-build-fails-when-i-use-testunit-even-when-all-tests-passed)
120
120
  - [Why I see HEAD as branch name in user dashboard for Build metrics for my API token?](#why-i-see-head-as-branch-name-in-user-dashboard-for-build-metrics-for-my-api-token)
121
+ - [Why Capybara feature tests randomly fail when using CI parallelisation?](#why-capybara-feature-tests-randomly-fail-when-using-ci-parallelisation)
121
122
  - [Queue Mode problems](#queue-mode-problems)
122
123
  - [Why when I use Queue Mode for RSpec then my tests fail?](#why-when-i-use-queue-mode-for-rspec-then-my-tests-fail)
123
124
  - [Why when I use Queue Mode for RSpec then FactoryBot/FactoryGirl tests fail?](#why-when-i-use-queue-mode-for-rspec-then-factorybotfactorygirl-tests-fail)
125
+ - [Why when I use Queue Mode for RSpec then I see error `superclass mismatch for class`?](#why-when-i-use-queue-mode-for-rspec-then-i-see-error-superclass-mismatch-for-class)
124
126
  - [Why I don't see collected time execution data for my build in user dashboard?](#why-i-dont-see-collected-time-execution-data-for-my-build-in-user-dashboard)
125
127
  - [Why when I use Queue Mode for RSpec and test fails then I see multiple times info about failed test in RSpec result?](#why-when-i-use-queue-mode-for-rspec-and-test-fails-then-i-see-multiple-times-info-about-failed-test-in-rspec-result)
126
128
  - [Why when I use Queue Mode for RSpec then I see multiple times the same pending tests?](#why-when-i-use-queue-mode-for-rspec-then-i-see-multiple-times-the-same-pending-tests)
@@ -129,6 +131,7 @@ The knapsack_pro has also [queue mode](#queue-mode) to get an optimal test suite
129
131
  - [How to fix capybara-screenshot fail with `SystemStackError: stack level too deep` when using Queue Mode for RSpec?](#how-to-fix-capybara-screenshot-fail-with-systemstackerror-stack-level-too-deep-when-using-queue-mode-for-rspec)
130
132
  - [Parallel tests Cucumber and RSpec with Cucumber failures exit CI node early leaving fewer CI nodes to finish RSpec Queue.](#parallel-tests-cucumber-and-rspec-with-cucumber-failures-exit-ci-node-early-leaving-fewer-ci-nodes-to-finish-rspec-queue)
131
133
  - [Why when I reran the same build (same commit hash, etc) on Codeship then no tests would get executed in Queue Mode?](#why-when-i-reran-the-same-build-same-commit-hash-etc-on-codeship-then-no-tests-would-get-executed-in-queue-mode)
134
+ - [Why knapsack_pro hangs / freezes / is stale i.e. for Codeship in Queue Mode?](#why-knapsack_pro-hangs--freezes--is-stale-ie-for-codeship-in-queue-mode)
132
135
  - [How to find seed in RSpec output when I use Queue Mode for RSpec?](#how-to-find-seed-in-rspec-output-when-i-use-queue-mode-for-rspec)
133
136
  - [General questions](#general-questions)
134
137
  - [How to run tests for particular CI node in your development environment](#how-to-run-tests-for-particular-ci-node-in-your-development-environment)
@@ -885,9 +888,9 @@ Here you can find article [how to set up a new pipeline for your project in Buil
885
888
 
886
889
  If you want to use Buildkite retry single agent feature to retry just failed tests on particular agent (CI node) then you should set [`KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true`](#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node).
887
890
 
888
- #### Info for Gitlab CI users
891
+ #### Info for GitLab CI users
889
892
 
890
- Remember to add API tokens like `KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER` and `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` to [Secret Variables](https://gitlab.com/help/ci/variables/README.md#secret-variables) in `Gitlab CI Settings -> CI/CD Pipelines -> Secret Variables`.
893
+ Remember to add API tokens like `KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER` and `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` to [Secret Variables](https://gitlab.com/help/ci/variables/README.md#secret-variables) in `GitLab CI Settings -> CI/CD Pipelines -> Secret Variables`.
891
894
 
892
895
  ##### GitLab CI `>= 11.5`
893
896
 
@@ -895,17 +898,19 @@ Remember to add API tokens like `KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER` and `KN
895
898
  test:
896
899
  parallel: 2
897
900
 
898
- # RSpec tests in Knapsack Pro Queue Mode (dynamic test suite split)
899
- script: bundle exec rake knapsack_pro:queue:rspec
901
+ # Knapsack Pro Regular Mode (deterministic test suite split)
902
+ script: bundle exec rake knapsack_pro:rspec
900
903
 
901
904
  # Other commands you could use:
902
905
 
903
906
  # Knapsack Pro Regular Mode (deterministic test suite split)
904
- # bundle exec rake knapsack_pro:rspec
905
907
  # bundle exec rake knapsack_pro:cucumber
906
908
  # bundle exec rake knapsack_pro:minitest
909
+ # bundle exec rake knapsack_pro:test_unit
910
+ # bundle exec rake knapsack_pro:spinach
907
911
 
908
912
  # Knapsack Pro Queue Mode (dynamic test suite split)
913
+ # bundle exec rake knapsack_pro:queue:rspec
909
914
  # bundle exec rake knapsack_pro:queue:minitest
910
915
  ```
911
916
 
@@ -913,7 +918,7 @@ Here you can find info [how to configure the GitLab parallel CI nodes](https://d
913
918
 
914
919
  ##### GitLab CI `< 11.5` (old GitLab CI)
915
920
 
916
- Gitlab CI does not provide parallel jobs environment variables so you will have to define `KNAPSACK_PRO_CI_NODE_TOTAL` and `KNAPSACK_PRO_CI_NODE_INDEX` for each parallel job running as part of the same `test` stage. Below is relevant part of `.gitlab-ci.yml` configuration for 2 parallel jobs.
921
+ GitLab CI does not provide parallel jobs environment variables so you will have to define `KNAPSACK_PRO_CI_NODE_TOTAL` and `KNAPSACK_PRO_CI_NODE_INDEX` for each parallel job running as part of the same `test` stage. Below is relevant part of `.gitlab-ci.yml` configuration for 2 parallel jobs.
917
922
 
918
923
  ```
919
924
  # .gitlab-ci.yml
@@ -1220,6 +1225,20 @@ knapack_pro uses git command `git -C /home/user/project_dir rev-parse --abbrev-r
1220
1225
 
1221
1226
  If you would like to see exact branch name instead of `HEAD` in your `build metrics` history in [user dashboard](https://knapsackpro.com/dashboard) then you can explicitly provide the branch name with `KNAPSACK_PRO_BRANCH` for each CI build.
1222
1227
 
1228
+ #### Why Capybara feature tests randomly fail when using CI parallelisation?
1229
+
1230
+ It can happen that when you use CI parallelisation then your CI machine is overloaded and some of Capybara feature specs may randomly fail when tested website loaded slowly.
1231
+
1232
+ You can try to increase default Capybara max wait time from 2 seconds to something bigger like 5 seconds to ensure the Capybara will wait longer till the website is loaded before marking test as failed.
1233
+
1234
+ ```ruby
1235
+ # spec/rails_helper.rb
1236
+ Capybara.default_max_wait_time = 5 # in seconds
1237
+ ```
1238
+
1239
+ For instance, this tip might be helpful for Heroku CI users who use Heroku dynos with lower performance.
1240
+
1241
+
1223
1242
  #### Queue Mode problems
1224
1243
 
1225
1244
  ##### Why when I use Queue Mode for RSpec then my tests fail?
@@ -1265,6 +1284,60 @@ FactoryBot.define do
1265
1284
  end
1266
1285
  ```
1267
1286
 
1287
+ ##### Why when I use Queue Mode for RSpec then I see error `superclass mismatch for class`?
1288
+
1289
+ You may see error like:
1290
+
1291
+ ```
1292
+ TypeError:
1293
+ superclass mismatch for class BatchClass
1294
+ ```
1295
+
1296
+ when you have 2 test files like this one:
1297
+
1298
+ ```
1299
+ # spec/a_spec.rb
1300
+ class BaseBatchClass
1301
+ end
1302
+
1303
+ module Mock
1304
+ module FakeModels
1305
+ class BatchClass < BaseBatchClass
1306
+ def args
1307
+ end
1308
+ end
1309
+ end
1310
+ end
1311
+
1312
+ describe 'A test of something' do
1313
+ it do
1314
+ end
1315
+ end
1316
+ ```
1317
+
1318
+ ```
1319
+ # spec/b_spec.rb
1320
+ class DifferentBaseBatchClass
1321
+ end
1322
+
1323
+ module Mock
1324
+ module FakeModels
1325
+ # Note the base class is different here!
1326
+ class BatchClass < DifferentBaseBatchClass
1327
+ def args
1328
+ end
1329
+ end
1330
+ end
1331
+ end
1332
+
1333
+ describe 'B test of something' do
1334
+ it do
1335
+ end
1336
+ end
1337
+ ```
1338
+
1339
+ Instead of mocking like shown above you could use [RSpec stub_const](https://relishapp.com/rspec/rspec-mocks/docs/mutating-constants) to solve error `superclass mismatch for class BatchClass`.
1340
+
1268
1341
  ##### Why I don't see collected time execution data for my build in user dashboard?
1269
1342
 
1270
1343
  If you go to [user dashboard](https://knapsackpro.com/dashboard) and open `Build metrics` for your API token and you open build for your last git commit you should see there info about collected time execution data from all CI nodes. If you don't see collected time execution data for CI nodes then please ensure:
@@ -1342,6 +1415,14 @@ There is one edge case with that solution. Please note that the knapsack_pro gem
1342
1415
 
1343
1416
  To avoid this you should specify a unique `KNAPSACK_PRO_CI_NODE_BUILD_ID` environment variable for each CI build. This mean that each CI node that is part of particular CI build should have the same value for `KNAPSACK_PRO_CI_NODE_BUILD_ID`.
1344
1417
 
1418
+ ##### Why knapsack_pro hangs / freezes / is stale i.e. for Codeship in Queue Mode?
1419
+
1420
+ Some users with larger projects notice that in Queue Mode knapsack_pro ruby process hangs, for instance for CodeShip CI users.
1421
+
1422
+ It happens due too big RSpec log output in Queue Mode. To produce less logs on output you can change log level to `KNAPSACK_PRO_LOG_LEVEL=warn`.
1423
+
1424
+ Learn more about [log levels](#how-can-i-change-log-level).
1425
+
1345
1426
  ##### How to find seed in RSpec output when I use Queue Mode for RSpec?
1346
1427
 
1347
1428
  In output for RSpec in knapack_pro Queue Mode you may see message:
@@ -103,7 +103,7 @@ module KnapsackPro
103
103
  end
104
104
 
105
105
  response_body
106
- rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, EOFError, SocketError, Net::OpenTimeout, Net::ReadTimeout => e
106
+ rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, Errno::EPIPE, EOFError, SocketError, Net::OpenTimeout, Net::ReadTimeout => e
107
107
  logger.warn(e.inspect)
108
108
  retries += 1
109
109
  if retries < 3
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-15 00:00:00.000000000 Z
11
+ date: 2019-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -42,22 +42,22 @@ dependencies:
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '3.0'
48
45
  - - ">="
49
46
  - !ruby/object:Gem::Version
50
47
  version: 2.10.0
48
+ - - "~>"
49
+ - !ruby/object:Gem::Version
50
+ version: '3.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: '3.0'
58
55
  - - ">="
59
56
  - !ruby/object:Gem::Version
60
57
  version: 2.10.0
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.0'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rspec-its
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -392,7 +392,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
392
392
  version: '0'
393
393
  requirements: []
394
394
  rubyforge_project:
395
- rubygems_version: 2.7.6
395
+ rubygems_version: 2.7.8
396
396
  signing_key:
397
397
  specification_version: 4
398
398
  summary: Knapsack Pro splits tests across CI nodes and makes sure that tests will