knapsack_pro 7.0.1 → 7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd0d61c51dbf5b1db810f1249e058149831a3e502af11158bcb112ca02f83bf8
4
- data.tar.gz: 8c281aa9ed386c01f857f60212f469fdb1364ff3ffc3111e60cdcb0a1557dc35
3
+ metadata.gz: 5fa2cbdcdebace591370260b651732d348da4b27010a0059bd90cb4d193b8486
4
+ data.tar.gz: fbfd4447d1c74132d48bc29ceb0f3293be0825c5e9dd8e682ab874c53a6b3ab7
5
5
  SHA512:
6
- metadata.gz: b3f306e986304db8084259385b375681b4bf7bad16351fbe15bf3c5d624ab31648a42e2efafb8cc3bdd3eef7ce2ea49df91d9fa87b1a812830aaf6d3e489cb89
7
- data.tar.gz: 867302738082653b366f08265224463186ea19069e147d281020ef1a76c6c480398922913fdf92d3ad1971fe792be69e204b4087e589eeac66b705fabc6a7879
6
+ metadata.gz: a4d0029246717da43f525bc8826b4068c7727731e532278386ef0fc8e6d76e7108ff4f660da88d97e12e531fa8e10e85c6d8626035eb4c15c5fada7ef5318258
7
+ data.tar.gz: ff749f54cc9ebd40ff0ae3a06e1b4693df88ee4c307d43b59b3c6fc9ef94ff1ba462a110016511ec882f8b54a172c76e0b8e16e8bb549ebc763f245357577da9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ### 7.2.0
4
+
5
+ * Always use the original `Net::HTTP` client, even when WebMock replaces it with its own
6
+ * No action is required on your side, but you can delete the following code that you may have used to configure Knapsack Pro with WebMock or VCR:
7
+ ```diff
8
+ WebMock.disable_net_connect!(
9
+ allow_localhost: true,
10
+ - allow: ['api.knapsackpro.com']
11
+ )
12
+
13
+ # VCR
14
+ - config.ignore_hosts('localhost', '127.0.0.1', '0.0.0.0', 'api.knapsackpro.com')
15
+ + config.ignore_localhost = true
16
+ ```
17
+
18
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/251
19
+
20
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.1.0...v7.2.0
21
+
22
+ ### 7.1.0
23
+
24
+ * [RSpec] [Queue Mode] Log error message and backtrace when unexpected failure is raised
25
+
26
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/249
27
+
28
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.0.1...v7.1.0
29
+
3
30
  ### 7.0.1
4
31
 
5
32
  * fix(RSpec): conditionally adds `--require rails_helper` to cli arguments of `KnapsackPro::Runners::Queue::RSpecRunner`. Version 7.0.0 introduced some fundamental changes, namely fetching, loading and running batches of specs **after** executing suite hooks, so that such hooks are only ran once, not before every batch. As a result, if `rails_helper` is only required in spec files, which is the RSpec default, instead of e.g. in `.rspec`, then some `before(:suite)` hooks, e.g. defined by gems, are registered after suite hooks had already been executed by the test suite. By comparison, RSpec loads all the spec files **before** executing `before(:suite)` hooks.
@@ -28,6 +55,25 @@ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.0.0...v7.0.1
28
55
  __After:__<br>
29
56
  The `KnapsackPro::Hooks::Queue.after_queue` hook is executed __inside__ of the `after(:suite)` hook.
30
57
 
58
+ * The RSpec `filter_run_excluding` option is not supported in Queue Mode.
59
+
60
+ __Before:__ The following option won't run tests tagged with `:manual`.<br>
61
+
62
+ ```ruby
63
+ # spec_helper.rb
64
+ RSpec.configure do |config|
65
+ config.filter_run_excluding :manual
66
+ end
67
+ ```
68
+
69
+ __After:__ The RSpec `filter_run_excluding` option is ignored in Queue Mode. You must manually pass the `--tag ~manual` option to the Knapsack Pro command to skip tests tagged with `:manual`.
70
+
71
+ ```
72
+ bundle exec rake "knapsack_pro:queue:rspec[--tag ~manual]"
73
+ ```
74
+
75
+ * Please [update the datadog-ci gem to the latest version](https://github.com/DataDog/datadog-ci-rb/issues/147#issuecomment-2099997045) if you use DataDog. This allows DataDog to collect RSpec data correctly in Knapsack Pro Queue Mode.
76
+
31
77
  * Recommended RSpec changes in your project:
32
78
  * Remove the following code if you use Queue Mode and the `rspec_junit_formatter` gem to generate JUnit XML or JSON reports:
33
79
 
@@ -141,13 +141,21 @@ module KnapsackPro
141
141
  end
142
142
 
143
143
  def build_http(uri)
144
- http = Net::HTTP.new(uri.host, uri.port)
144
+ http = net_http.new(uri.host, uri.port)
145
145
  http.use_ssl = (uri.scheme == 'https')
146
146
  http.open_timeout = TIMEOUT
147
147
  http.read_timeout = TIMEOUT
148
148
  http
149
149
  end
150
150
 
151
+ def net_http
152
+ if defined?(WebMock::HttpLibAdapters::NetHttpAdapter::OriginalNetHTTP)
153
+ WebMock::HttpLibAdapters::NetHttpAdapter::OriginalNetHTTP
154
+ else
155
+ Net::HTTP
156
+ end
157
+ end
158
+
151
159
  def post
152
160
  uri = URI.parse(endpoint_url)
153
161
  http = build_http(uri)
@@ -56,6 +56,8 @@ module KnapsackPro
56
56
  Kernel.exit(exit_code)
57
57
  rescue Exception => exception
58
58
  KnapsackPro.logger.error("An unexpected exception happened. RSpec cannot handle it. The exception: #{exception.inspect}")
59
+ KnapsackPro.logger.error("Exception message: #{exception.message}")
60
+ KnapsackPro.logger.error("Exception backtrace: #{exception.backtrace.join("\n")}")
59
61
 
60
62
  message = @rspec_pure.exit_summary(unexecuted_test_files)
61
63
  KnapsackPro.logger.warn(message) if message
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KnapsackPro
4
- VERSION = '7.0.1'
4
+ VERSION = '7.2.0'
5
5
  end
@@ -1115,6 +1115,8 @@ describe "#{KnapsackPro::Runners::Queue::RSpecRunner} - Integration tests", :cle
1115
1115
 
1116
1116
  expect(actual.stdout).to include('B_describe')
1117
1117
  expect(actual.stdout).to include('An unexpected exception happened. RSpec cannot handle it. The exception: #<NoMemoryError: NoMemoryError>')
1118
+ expect(actual.stdout).to include('Exception message: ')
1119
+ expect(actual.stdout).to include('Exception backtrace: ')
1118
1120
  expect(actual.stdout).to_not include('B1 test example')
1119
1121
 
1120
1122
  expect(actual.stdout).to_not include('C1 test example')
data/spec/spec_helper.rb CHANGED
@@ -40,4 +40,8 @@ RSpec.configure do |config|
40
40
  FileUtils.rm_r(KNAPSACK_PRO_TMP_DIR) if File.exist?(KNAPSACK_PRO_TMP_DIR)
41
41
  end
42
42
  end
43
+
44
+ config.before(:each) do
45
+ allow_any_instance_of(KnapsackPro::Client::Connection).to receive(:net_http).and_return(Net::HTTP)
46
+ end
43
47
  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: 7.0.1
4
+ version: 7.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: 2024-03-11 00:00:00.000000000 Z
11
+ date: 2024-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -412,7 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
412
412
  - !ruby/object:Gem::Version
413
413
  version: '0'
414
414
  requirements: []
415
- rubygems_version: 3.5.6
415
+ rubygems_version: 3.4.10
416
416
  signing_key:
417
417
  specification_version: 4
418
418
  summary: Knapsack Pro splits tests across parallel CI nodes and ensures each parallel