testcontainers-rabbitmq 0.1.0 → 0.2.0

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: 5d97a9dd11ccfa2cdf0306fee0ce355a1ae6ae7d9cc242c62e0f450734d3afd1
4
- data.tar.gz: eb2f0e776019538d07c04e2bc5b434fecb7fb387868b23040bce4d27e13ca674
3
+ metadata.gz: 2905de76409b8b37cb41528571ed1b18abfa276f839b0cb06fbacf0986246bb9
4
+ data.tar.gz: 43fa306e8e3d8bf100213b9e076af51690e0b8a9f31d0b70b843406ba2922af1
5
5
  SHA512:
6
- metadata.gz: b1ee3ea2117c31d37ce6ea6cb52924b9614c97577166442b69eb3c0a59b766bd5f4b35bf008fa38b64e195f45f6c91bcf93db46ef01370ac27ebb3df210f6fa1
7
- data.tar.gz: c127eb5be4b1f6ee4f758ef2476e7b820185e93f7f23b6f7f88010de2caf594304530d3456802a573f8ab22bd4fda96226b9c183fc2ec8c444936b875a567e92
6
+ metadata.gz: f222e8a496bfb55101d3e912c39c15b58e5f80dc5029c3f719a04b6bdc2bf624bba446b94b3ff85ce0ae0dd953d3c2ccae4c6920d0d877c9ea6072f5b1f7b8b7
7
+ data.tar.gz: b8eda61a9361118afa857ab63a187fda02044b98ea0603ba6f2929112a01da7920f947d79a9d89f9e52499da18d947488dc48d7e34230d0d4b12bc6cc3fa290e
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: ../core
3
3
  specs:
4
- testcontainers-core (0.1.3)
4
+ testcontainers-core (0.2.0)
5
5
  docker-api (~> 2.2)
6
6
 
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- testcontainers-rabbitmq (0.1.0)
11
- testcontainers-core (~> 0.1.3)
10
+ testcontainers-rabbitmq (0.2.0)
11
+ testcontainers-core (~> 0.1)
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
@@ -72,6 +72,7 @@ GEM
72
72
 
73
73
  PLATFORMS
74
74
  arm64-darwin-21
75
+ ruby
75
76
  x86_64-darwin-22
76
77
 
77
78
  DEPENDENCIES
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Testcontainers
4
4
  module Rabbitmq
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -24,6 +24,11 @@ module Testcontainers
24
24
  # Default vhost used by the container
25
25
  RABBITMQ_DEFAULT_VHOST = "/"
26
26
 
27
+ # Default "wait for" strategy
28
+ WAIT_FOR_PROC = ->(container) {
29
+ container.wait_for_logs(/startup complete/, timeout: 20)
30
+ }
31
+
27
32
  attr_reader :username, :password, :vhost
28
33
 
29
34
  # Initializes a new instance of RabbitMQContainer
@@ -31,23 +36,20 @@ module Testcontainers
31
36
  # @param image [String] the image to use
32
37
  # @param username [String] the username to use
33
38
  # @param password [String] the password to use
34
- # @param port [String] the port to use
39
+ # @param vhost [String]
35
40
  # @param kwargs [Hash] the options to pass to the container. See {DockerContainer#initialize}
36
41
  # @return [RabbitmqContainer] a new instance of RabbitmqContainer
37
42
  def initialize(image = RABBITMQ_DEFAULT_IMAGE, username: nil, password: nil, vhost: nil, **kwargs)
38
- super(image, **kwargs)
43
+ super(image, wait_for: WAIT_FOR_PROC, exposed_ports: [RABBITMQ_QUEUE_DEFAULT_PORT, RABBITMQ_MGMT_UI_DEFAULT_PORT], **kwargs)
39
44
  @username = username || ENV.fetch("RABBITMQ_USER", RABBITMQ_DEFAULT_USER)
40
45
  @password = password || ENV.fetch("RABBITMQ_PASSWORD", RABBITMQ_DEFAULT_PASS)
41
46
  @vhost = vhost || ENV.fetch("RABBITMQ_VHOST", RABBITMQ_DEFAULT_VHOST)
42
- @healthcheck ||= add_healthcheck(_default_healthcheck_options)
43
- @wait_for ||= add_wait_for(:healthcheck)
44
47
  end
45
48
 
46
49
  # Starts the container
47
50
  #
48
51
  # @return [RabbitmqContainer] self
49
52
  def start
50
- with_exposed_ports([port, management_ui_port])
51
53
  _configure
52
54
  super
53
55
  end
@@ -69,7 +71,7 @@ module Testcontainers
69
71
 
70
72
  # Returns the rabbitmq connection url (e.g. amqp://user:password@host:port/vhost)
71
73
  #
72
- # @param protocol [String] the protocol to use in the string (default: "mysql")
74
+ # @param protocol [String] the protocol to use in the string (default: "amqp://")
73
75
  # @param database [String] the database to use in the string (default: @database)
74
76
  # @param options [Hash] the options to use in the query string (default: {})
75
77
  # @return [String] the rabbitmq url
@@ -142,9 +144,5 @@ module Testcontainers
142
144
  add_env("RABBITMQ_DEFAULT_PASS", @password)
143
145
  add_env("RABBITMQ_DEFAULT_VHOST", @vhost) if @vhost
144
146
  end
145
-
146
- def _default_healthcheck_options
147
- {test: %w[rabbitmqctl node_health_check], interval: 10, timeout: 10, retries: 5}
148
- end
149
147
  end
150
148
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcontainers-rabbitmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Piza
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-06-10 00:00:00.000000000 Z
12
+ date: 2024-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: testcontainers-core
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 0.1.3
20
+ version: '0.1'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 0.1.3
27
+ version: '0.1'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 3.4.1
137
+ rubygems_version: 3.4.14
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: 'Testcontainers for Ruby: Rabbitmq module'