knapsack_pro 1.20.1 → 1.20.2

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: 603cc339299caaeadecbe441f06abc2e8f169d0fa6acb6985dc286a770a120cd
4
- data.tar.gz: 73b1e4583dbcc37d99aceeeb4029ffd2899bc3bc398b37278db1de36d92f44cf
3
+ metadata.gz: 6bbc828d338c810094114953894489db0696b70f013beac451b1c45602c323cd
4
+ data.tar.gz: ae287454ad0658666d1d0cd85c4eaf91eabe009ee95b05b3a76d719a245395ae
5
5
  SHA512:
6
- metadata.gz: b5fcb7fd656ec4c9363b91c7b45cefb5b095588c53934fd5b173e68188059342a5d7545b344ec55cecd055917ea8cfb8413a438c453306c7769268d18c9c9f1b
7
- data.tar.gz: ac11b94615e74cac40ffc49e5d62cf890f180d19912bc8dd6a13b27721b4286f5c22b0c49dbf2d37ce505e4d7b049393b078375dd4ccbfd7d3a7f1ba044eefb1
6
+ metadata.gz: f70aca52cc3808f0028d036dd8b5057130cf6610ede948075a293c3165ddf46e44e8fdf922e7457808dca8f390ded887adb5f4c95146a5b925535621b1de7a93
7
+ data.tar.gz: 32e5fb5098e39fdb93694184b16c26603ca1edcdc193ab1c513ab9cd55800fa2c54157b28b365260d2e2231bd3bea6ffcc5b2b1921c9076ab75e37095433e5ef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ### 1.20.2
4
+
5
+ * Raise an error when running Cucumber in Queue Mode and Cucumber system process doesn't finish execution correctly (for instance Cucumber process was killed by CI server due to lack of memory)
6
+
7
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/111
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v1.20.1...v1.20.2
10
+
3
11
  ### 1.20.1
4
12
 
5
13
  * Fix bug in RSpec split by test examples in < RSpec 3.6.0 (related to custom json formatter)
data/README.md CHANGED
@@ -597,10 +597,10 @@ At this moment the queue mode works for:
597
597
 
598
598
  ## Split test files by test cases
599
599
 
600
- __Note:__ this is an experimental feature. It works for Regular Mode and Queue Mode. For large test suite with a few thousand test files, it may generate too many RSpec test example paths that may lead to too large JSON payload in request to Knapsack Pro API and this could trigger the API timeout.
601
-
602
- Please give us feedback so we could improve the feature.
603
- https://knapsackpro.com/contact
600
+ > __Note:__ this is an experimental feature. It works for Regular Mode and Queue Mode. For large test suite with a few thousand test files, it may generate too many RSpec test example paths that may lead to too large JSON payload in request to Knapsack Pro API and this could trigger the API timeout.
601
+ >
602
+ > Please give us feedback so we could improve the feature.
603
+ > https://knapsackpro.com/contact
604
604
 
605
605
  __How it works__: You can split slow test file by test cases. Thanks to that the test file can be split across parallel CI nodes because test cases from the test file will run on different CI nodes.
606
606
 
@@ -608,7 +608,7 @@ This is helpful when you have one or a few very slow test files that are a bottl
608
608
 
609
609
  ### RSpec split test files by test examples (by individual `it`s)
610
610
 
611
- __Requirement:__ It works with >= RSpec 3.6.0.
611
+ > ❗ __WARNING (known issues):__ This is an experimental feature. We detected edge cases for Queue Mode when test examples might be ignored by RSpec and won't run test. Do not use this feature for production yet. We'll appreciate your [feedback](https://knapsackpro.com/contact) how it works while you test it on a separate branch. We work on improvements.
612
612
 
613
613
  In order to split RSpec test files by test examples across parallel CI nodes you need to set environment variable:
614
614
 
@@ -37,7 +37,7 @@ module KnapsackPro
37
37
  if test_files.empty?
38
38
  KnapsackPro.logger.warn("No test files were executed on this CI node.")
39
39
  KnapsackPro.logger.debug("When you use knapsack_pro queue mode then probably reason might be that CI node was started after the test files from the queue were already executed by other CI nodes. That is why this CI node has no test files to execute.")
40
- KnapsackPro.logger.debug("Another reason might be when your CI node failed in a way that prevented knapsack_pro to save time execution data to Knapsack Pro API and you have just tried to retry failed CI node but instead you got no test files to execute. In that case knapsack_pro don't know what testes should be executed here.")
40
+ KnapsackPro.logger.debug("Another reason might be when your CI node failed in a way that prevented knapsack_pro to save time execution data to Knapsack Pro API and you have just tried to retry failed CI node but instead you got no test files to execute. In that case knapsack_pro don't know what tests should be executed here.")
41
41
  end
42
42
 
43
43
  measured_test_files = test_files
@@ -91,7 +91,16 @@ module KnapsackPro
91
91
  # which is defined in lib/knapsack_pro/adapters/cucumber_adapter.rb
92
92
  ENV['KNAPSACK_PRO_BEFORE_QUEUE_HOOK_CALLED'] = 'true'
93
93
 
94
- $?.exitstatus
94
+ process_status = $?
95
+
96
+ unless process_status.exited?
97
+ raise "Cucumber process execution failed. It's likely that your CI server has exceeded"\
98
+ " its available memory. Please try changing CI config or retrying the CI build.\n"\
99
+ "Failed command: #{cmd}\n"\
100
+ "Process status: #{process_status.inspect}"
101
+ end
102
+
103
+ process_status.exitstatus
95
104
  end
96
105
  end
97
106
  end
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '1.20.1'
2
+ VERSION = '1.20.2'
3
3
  end
@@ -129,7 +129,7 @@ describe KnapsackPro::Report do
129
129
  expect(KnapsackPro).to receive(:logger).exactly(3).and_return(logger)
130
130
  expect(logger).to receive(:warn).with('No test files were executed on this CI node.')
131
131
  expect(logger).to receive(:debug).with('When you use knapsack_pro queue mode then probably reason might be that CI node was started after the test files from the queue were already executed by other CI nodes. That is why this CI node has no test files to execute.')
132
- expect(logger).to receive(:debug).with("Another reason might be when your CI node failed in a way that prevented knapsack_pro to save time execution data to Knapsack Pro API and you have just tried to retry failed CI node but instead you got no test files to execute. In that case knapsack_pro don't know what testes should be executed here.")
132
+ expect(logger).to receive(:debug).with("Another reason might be when your CI node failed in a way that prevented knapsack_pro to save time execution data to Knapsack Pro API and you have just tried to retry failed CI node but instead you got no test files to execute. In that case knapsack_pro don't know what tests should be executed here.")
133
133
 
134
134
  expect(described_class).to receive(:create_build_subset).with([])
135
135
 
@@ -117,36 +117,49 @@ describe KnapsackPro::Runners::Queue::CucumberRunner do
117
117
 
118
118
  expect(ENV).to receive(:[]=).with('KNAPSACK_PRO_BEFORE_QUEUE_HOOK_CALLED', 'true')
119
119
 
120
- expect($?).to receive(:exitstatus).and_return(exitstatus)
120
+ expect($?).to receive(:exited?).and_return(process_exited)
121
+ allow($?).to receive(:exitstatus).and_return(exitstatus)
121
122
  end
122
123
 
123
- context 'when tests are passing' do
124
- let(:exitstatus) { 0 }
125
-
126
- it 'returns exit code 0' do
127
- expect(subject).to eq({
128
- status: :next,
129
- runner: runner,
130
- can_initialize_queue: false,
131
- args: args,
132
- exitstatus: exitstatus,
133
- all_test_file_paths: test_file_paths,
134
- })
124
+ context 'when system process finished its work (exited)' do
125
+ let(:process_exited) { true }
126
+
127
+ context 'when tests are passing' do
128
+ let(:exitstatus) { 0 }
129
+
130
+ it 'returns exit code 0' do
131
+ expect(subject).to eq({
132
+ status: :next,
133
+ runner: runner,
134
+ can_initialize_queue: false,
135
+ args: args,
136
+ exitstatus: exitstatus,
137
+ all_test_file_paths: test_file_paths,
138
+ })
139
+ end
140
+ end
141
+
142
+ context 'when tests are failing' do
143
+ let(:exitstatus) { 1 }
144
+
145
+ it 'returns exit code 1' do
146
+ expect(subject).to eq({
147
+ status: :next,
148
+ runner: runner,
149
+ can_initialize_queue: false,
150
+ args: args,
151
+ exitstatus: 1, # tests failed
152
+ all_test_file_paths: test_file_paths,
153
+ })
154
+ end
135
155
  end
136
156
  end
137
157
 
138
- context 'when tests are failing' do
139
- let(:exitstatus) { 1 }
140
-
141
- it 'returns exit code 1' do
142
- expect(subject).to eq({
143
- status: :next,
144
- runner: runner,
145
- can_initialize_queue: false,
146
- args: args,
147
- exitstatus: 1, # tests failed
148
- all_test_file_paths: test_file_paths,
149
- })
158
+ context "when system process didn't finish its work (hasn't exited)" do
159
+ let(:process_exited) { false }
160
+
161
+ it 'raises an error' do
162
+ expect { subject }.to raise_error(RuntimeError, /^Cucumber process execution failed/)
150
163
  end
151
164
  end
152
165
  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.20.1
4
+ version: 1.20.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-09 00:00:00.000000000 Z
11
+ date: 2020-05-02 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: 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
@@ -410,7 +410,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
410
  - !ruby/object:Gem::Version
411
411
  version: '0'
412
412
  requirements: []
413
- rubygems_version: 3.0.6
413
+ rubyforge_project:
414
+ rubygems_version: 2.7.6
414
415
  signing_key:
415
416
  specification_version: 4
416
417
  summary: Knapsack Pro splits tests across parallel CI nodes and ensures each parallel