test-prof 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/test_prof/before_all/adapters/active_record.rb +16 -1
- data/lib/test_prof/version.rb +1 -1
- 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: 13127b82bf827a56e15c8d060ff5a8e5be791e16deea31e899d88ecd7b76bb38
|
4
|
+
data.tar.gz: 1ae017bc058b3017355c75fd871c17aad9ec3649f7b982af062d606b93d9fe2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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|
|
data/lib/test_prof/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2023-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|