knapsack_pro 3.1.0 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/README.md +5 -0
- data/lib/knapsack_pro/client/connection.rb +1 -1
- data/lib/knapsack_pro/runners/queue/rspec_runner.rb +2 -2
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fec041f1d838c8672e70c4a3703a2adfd3d727c912b2543c88c3cf01fe9ae65
|
4
|
+
data.tar.gz: 789349de506fcc48e3e76a881f9f87205544792c8d49243e4f20342c01627b01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b28ea456bda112b8c2329a4728b82fa5d3363a883d090a10066023bf246f6f12f98c573f62cefc3d791aacca27f18a37cfc294ddd61b6b5f43af4027e4818e16
|
7
|
+
data.tar.gz: 90ee101ba4dc5a01e13960fe1fd469259b3242b0b0daeccfbc38300c20a3b0d7bf9f3849be6ffc8ebd649705838549a06519e031c13ba4c0896d0f019b3e255c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,29 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 3.1.3
|
4
|
+
|
5
|
+
* Run Fallback Mode when `Errno::ECONNRESET` exception happens
|
6
|
+
|
7
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/164
|
8
|
+
|
9
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.1.2...v3.1.3
|
10
|
+
|
11
|
+
### 3.1.2
|
12
|
+
|
13
|
+
* 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
|
14
|
+
|
15
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/163
|
16
|
+
|
17
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.1.1...v3.1.2
|
18
|
+
|
19
|
+
### 3.1.1
|
20
|
+
|
21
|
+
* Rephrase log outputs in the Queue Mode RSpec runner
|
22
|
+
|
23
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/160
|
24
|
+
|
25
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.1.0...v3.1.1
|
26
|
+
|
3
27
|
### 3.1.0
|
4
28
|
|
5
29
|
* Use `.knapsack_pro` directory for temporary files instead of the `tmp` directory in the user's project directory
|
data/README.md
CHANGED
@@ -1714,6 +1714,11 @@ $ gem push knapsack_pro-X.X.X.gem
|
|
1714
1714
|
|
1715
1715
|
Update the latest available gem version in `TestSuiteClientVersionChecker` for the Knapsack Pro API repository.
|
1716
1716
|
|
1717
|
+
Update knapsack_pro gem version in:
|
1718
|
+
|
1719
|
+
* https://github.com/KnapsackPro/rails-app-with-knapsack_pro
|
1720
|
+
* our private Knapsack Pro API repository
|
1721
|
+
|
1717
1722
|
## Mentions
|
1718
1723
|
|
1719
1724
|
List of articles where people mentioned Knapsack Pro:
|
@@ -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)
|
@@ -110,9 +110,9 @@ module KnapsackPro
|
|
110
110
|
def self.log_rspec_command(cli_args, test_file_paths, type)
|
111
111
|
case type
|
112
112
|
when :subset_queue
|
113
|
-
KnapsackPro.logger.info("To retry
|
113
|
+
KnapsackPro.logger.info("To retry the last batch of tests fetched from the API Queue, please run the following command on your machine. (If you use the `-- order random` option, remember to add correct `--seed 123` that you can find at the end of the RSpec output.)")
|
114
114
|
when :end_of_queue
|
115
|
-
KnapsackPro.logger.info("To retry
|
115
|
+
KnapsackPro.logger.info("To retry all the tests assigned to this CI node, please run the following command on your machine:")
|
116
116
|
end
|
117
117
|
|
118
118
|
stringify_cli_args = cli_args.join(' ')
|
@@ -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.1.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|