knapsack_pro 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/lib/knapsack_pro/adapters/rspec_adapter.rb +5 -0
- data/lib/knapsack_pro/client/connection.rb +1 -1
- data/lib/knapsack_pro/slow_test_file_determiner.rb +2 -1
- data/lib/knapsack_pro/version.rb +1 -1
- data/spec/knapsack_pro/slow_test_file_determiner_spec.rb +32 -15
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5baae9cb1ea264d73e085e9f475b4f775e06801992ffd715f33a90fc93fd974f
|
4
|
+
data.tar.gz: e74b748147d57817546675c86ea534274f65cf287e52884d3960f09aa44efbb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f6102eef985cb8cb6c810053be5afecefcf309eb6a8367e3bcacdde09fb6bd10aa8d6ea10f68cdcdaf9b02a83117f2720ba6613562183c1ec9d52751ca87d56
|
7
|
+
data.tar.gz: b8c3d75e4267141135723fd29de4d5b97dffc1485dc762d7a9df0ba449c0827fa184261ffc101435b94678a7fc89bc8ed75876937a96d90ee6fd6103d7e38362
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,29 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 3.2.0
|
4
|
+
|
5
|
+
* Add an error message to `KnapsackPro::Adapters::RspecAdapter#bind`
|
6
|
+
|
7
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/165
|
8
|
+
|
9
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.1.3...v3.2.0
|
10
|
+
|
11
|
+
### 3.1.3
|
12
|
+
|
13
|
+
* Run Fallback Mode when `Errno::ECONNRESET` exception happens
|
14
|
+
|
15
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/164
|
16
|
+
|
17
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.1.2...v3.1.3
|
18
|
+
|
19
|
+
### 3.1.2
|
20
|
+
|
21
|
+
* Fix bug when test files have no recorded time execution then they should not be detected as slow test files for RSpec split by test examples feature
|
22
|
+
|
23
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/163
|
24
|
+
|
25
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.1.1...v3.1.2
|
26
|
+
|
3
27
|
### 3.1.1
|
4
28
|
|
5
29
|
* Rephrase log outputs in the Queue Mode RSpec runner
|
@@ -101,6 +101,11 @@ module KnapsackPro
|
|
101
101
|
# In case someone is doing switch from knapsack gem to the knapsack_pro gem
|
102
102
|
# and didn't notice the class name changed
|
103
103
|
class RspecAdapter < RSpecAdapter
|
104
|
+
def self.bind
|
105
|
+
error_message = 'You have attempted to call KnapsackPro::Adapters::RspecAdapter.bind. Please switch to using the new class name: KnapsackPro::Adapters::RSpecAdapter. See https://docs.knapsackpro.com/knapsack_pro-ruby/guide for up-to-date configuration instructions.'
|
106
|
+
KnapsackPro.logger.error(error_message)
|
107
|
+
raise error_message
|
108
|
+
end
|
104
109
|
end
|
105
110
|
end
|
106
111
|
end
|
@@ -119,7 +119,7 @@ module KnapsackPro
|
|
119
119
|
end
|
120
120
|
|
121
121
|
response_body
|
122
|
-
rescue ServerError, Errno::ECONNREFUSED, Errno::ETIMEDOUT, Errno::EPIPE, EOFError, SocketError, Net::OpenTimeout, Net::ReadTimeout, OpenSSL::SSL::SSLError => e
|
122
|
+
rescue ServerError, Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EPIPE, EOFError, SocketError, Net::OpenTimeout, Net::ReadTimeout, OpenSSL::SSL::SSLError => e
|
123
123
|
logger.warn("#{action.http_method.to_s.upcase} #{endpoint_url}")
|
124
124
|
logger.warn('Request failed due to:')
|
125
125
|
logger.warn(e.inspect)
|
@@ -8,7 +8,8 @@ module KnapsackPro
|
|
8
8
|
time_threshold = (time_execution / KnapsackPro::Config::Env.ci_node_total) * TIME_THRESHOLD_PER_CI_NODE
|
9
9
|
|
10
10
|
test_files.select do |test_file|
|
11
|
-
test_file.fetch('time_execution')
|
11
|
+
time_execution = test_file.fetch('time_execution')
|
12
|
+
time_execution >= time_threshold && time_execution > 0
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
data/lib/knapsack_pro/version.rb
CHANGED
@@ -1,16 +1,6 @@
|
|
1
1
|
describe KnapsackPro::SlowTestFileDeterminer do
|
2
2
|
describe '.call' do
|
3
3
|
let(:node_total) { 4 }
|
4
|
-
let(:time_execution) { 20.0 }
|
5
|
-
let(:test_files) do
|
6
|
-
[
|
7
|
-
{ 'path' => 'a_spec.rb', 'time_execution' => 1.0 },
|
8
|
-
{ 'path' => 'b_spec.rb', 'time_execution' => 3.4 },
|
9
|
-
# slow tests are above 3.5s threshold (20.0 / 4 * 0.7 = 3.5)
|
10
|
-
{ 'path' => 'c_spec.rb', 'time_execution' => 3.5 },
|
11
|
-
{ 'path' => 'd_spec.rb', 'time_execution' => 5.9 },
|
12
|
-
]
|
13
|
-
end
|
14
4
|
|
15
5
|
before do
|
16
6
|
expect(KnapsackPro::Config::Env).to receive(:ci_node_total).and_return(node_total)
|
@@ -18,11 +8,38 @@ describe KnapsackPro::SlowTestFileDeterminer do
|
|
18
8
|
|
19
9
|
subject { described_class.call(test_files, time_execution) }
|
20
10
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
11
|
+
context 'when test files have recorded time execution' do
|
12
|
+
let(:time_execution) { 20.0 }
|
13
|
+
let(:test_files) do
|
14
|
+
[
|
15
|
+
{ 'path' => 'a_spec.rb', 'time_execution' => 1.0 },
|
16
|
+
{ 'path' => 'b_spec.rb', 'time_execution' => 3.4 },
|
17
|
+
# slow tests are above 3.5s threshold (20.0 / 4 * 0.7 = 3.5)
|
18
|
+
{ 'path' => 'c_spec.rb', 'time_execution' => 3.5 },
|
19
|
+
{ 'path' => 'd_spec.rb', 'time_execution' => 5.9 },
|
20
|
+
]
|
21
|
+
end
|
22
|
+
|
23
|
+
it do
|
24
|
+
expect(subject).to eq([
|
25
|
+
{ 'path' => 'c_spec.rb', 'time_execution' => 3.5 },
|
26
|
+
{ 'path' => 'd_spec.rb', 'time_execution' => 5.9 },
|
27
|
+
])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'when test files have no recorded time execution' do
|
32
|
+
let(:time_execution) { 0.0 }
|
33
|
+
let(:test_files) do
|
34
|
+
[
|
35
|
+
{ 'path' => 'a_spec.rb', 'time_execution' => 0.0 },
|
36
|
+
{ 'path' => 'b_spec.rb', 'time_execution' => 0.0 },
|
37
|
+
]
|
38
|
+
end
|
39
|
+
|
40
|
+
it do
|
41
|
+
expect(subject).to eq([])
|
42
|
+
end
|
26
43
|
end
|
27
44
|
end
|
28
45
|
|
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: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -405,7 +405,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
405
405
|
- !ruby/object:Gem::Version
|
406
406
|
version: '0'
|
407
407
|
requirements: []
|
408
|
-
rubygems_version: 3.2.
|
408
|
+
rubygems_version: 3.2.32
|
409
409
|
signing_key:
|
410
410
|
specification_version: 4
|
411
411
|
summary: Knapsack Pro splits tests across parallel CI nodes and ensures each parallel
|