test-prof 1.2.1 → 1.2.2

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: c7db3f483d344fd783b2438241a2c1498789367740412a66b1586b1ba9a745e0
4
- data.tar.gz: a5c652b48e625d0872add68708a544ea9f929af83cd4e802dffdc277d01c2d5f
3
+ metadata.gz: 13127b82bf827a56e15c8d060ff5a8e5be791e16deea31e899d88ecd7b76bb38
4
+ data.tar.gz: 1ae017bc058b3017355c75fd871c17aad9ec3649f7b982af062d606b93d9fe2c
5
5
  SHA512:
6
- metadata.gz: ddb20836e08c4488e878b3dc91950f52a812251197b1e1ab697ec3f874d2c9a6ba891fe29bcf8124685ceafa58fa2fe953e873d9f5eff535bf60f55d786d52d6
7
- data.tar.gz: f54e9e90d3924a344ae97fe3fed45f976e7e91f8513a6a7190153dadeb215b00fa2c3920ea2903e5553c00e8968964b8119117423d1a2f49d9e0d4232f76f4b9
6
+ metadata.gz: b272b01aca1fb3bf9328fcd97fc148f5f329acf66650337071568aff6e20e1f3f95c066295df4777a7bd401976879bdddb3ff43fb2ce5093bca261fe65c07a94
7
+ data.tar.gz: 309644b36e328286ea52705196daa99e8af2f5237cf27f33ffa0091961f642eb29da73bcf48cb05e51896e3bfe9d709a1c08cbc1cfcd9abae1b429674a98fb2b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 1.2.2 (2023-06-27)
6
+
7
+ - Ignore inaccessible connection pools in `before_all`. ([@bf4][])
8
+
9
+ See [#267](https://github.com/test-prof/test-prof/pull/267).
10
+
5
11
  ## 1.2.1 (2023-03-22)
6
12
 
7
13
  - Fix regression with `before_all(setup_fixtures: true)` and `rspec-rails` v6.0+. ([@palkan][])
@@ -356,3 +362,4 @@ See [changelog](https://github.com/test-prof/test-prof/blob/v0.8.0/CHANGELOG.md)
356
362
  [@markedmondson]: https://github.com/markedmondson
357
363
  [@cbarton]: https://github.com/cbarton
358
364
  [@peret]: https://github.com/peret
365
+ [@bf4]: https://github.com/bf4
@@ -8,12 +8,27 @@ module TestProf
8
8
  class << self
9
9
  def all_connections
10
10
  @all_connections ||= if ::ActiveRecord::Base.respond_to? :connects_to
11
- ::ActiveRecord::Base.connection_handler.connection_pool_list.map(&:connection)
11
+ ::ActiveRecord::Base.connection_handler.connection_pool_list.filter_map { |pool|
12
+ begin
13
+ pool.connection
14
+ rescue *pool_connection_errors => error
15
+ log_pool_connection_error(pool, error)
16
+ nil
17
+ end
18
+ }
12
19
  else
13
20
  Array.wrap(::ActiveRecord::Base.connection)
14
21
  end
15
22
  end
16
23
 
24
+ def pool_connection_errors
25
+ @pool_connection_errors ||= []
26
+ end
27
+
28
+ def log_pool_connection_error(pool, error)
29
+ warn "Could not connect to pool #{pool.connection_class.name}. #{error.class}: #{error.message}"
30
+ end
31
+
17
32
  def begin_transaction
18
33
  @all_connections = nil
19
34
  all_connections.each do |connection|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TestProf
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-prof
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-22 00:00:00.000000000 Z
11
+ date: 2023-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler