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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6b697b425c2b1d68ff8e6816703e3b49528483d85cf581b529a62161d3e9ad4
4
- data.tar.gz: 39d542d0ecb1537ef711210d22bc79775d54d82e9dc033345dfa2b94495a3039
3
+ metadata.gz: 4fec041f1d838c8672e70c4a3703a2adfd3d727c912b2543c88c3cf01fe9ae65
4
+ data.tar.gz: 789349de506fcc48e3e76a881f9f87205544792c8d49243e4f20342c01627b01
5
5
  SHA512:
6
- metadata.gz: 3f1329d908f489309178bc989bac548a81fd8d3d53fa3a968d40eaa12d4fd67cef1788c177a4351e03ec65dd06c5785bc1ee15b9e8ade03648866519f5833f9c
7
- data.tar.gz: 6162c988f814c28e764567bec7a5fdaa15056626f857eb8a59d0895ec0103837dfa0c2c8ea0f1cca68ff0eab430b69ab584b21b9f3ecc1df086028b783cb2871
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 in development the subset of tests fetched from API queue please run below command on your machine. If you use --order random then remember to add proper --seed 123 that you will find at the end of rspec command.")
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 in development the tests for this CI node please run below command on your machine. It will run all tests in a single run. If you need to reproduce a particular subset of tests fetched from API queue then above after each request to Knapsack Pro API you will find example rspec command.")
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') >= time_threshold
11
+ time_execution = test_file.fetch('time_execution')
12
+ time_execution >= time_threshold && time_execution > 0
12
13
  end
13
14
  end
14
15
 
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '3.1.0'
2
+ VERSION = '3.1.3'
3
3
  end
@@ -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
- it do
22
- expect(subject).to eq([
23
- { 'path' => 'c_spec.rb', 'time_execution' => 3.5 },
24
- { 'path' => 'd_spec.rb', 'time_execution' => 5.9 },
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.0
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-08-17 00:00:00.000000000 Z
11
+ date: 2021-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake