Skip to content

Commit 7397720

Browse files
committed
Fix docker compose configuration.
1 parent 9208147 commit 7397720

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

.github/workflows/test-sentinel.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,11 @@ jobs:
4848
sudo apt-get update
4949
sudo apt-get install -y docker-compose
5050
51-
- name: Start services with Docker Compose
52-
run: docker-compose -f config/sentinel/docker-compose.yaml up -d
53-
5451
- uses: ruby/setup-ruby@v1
5552
with:
5653
ruby-version: ${{matrix.ruby}}
5754
bundler-cache: true
5855

5956
- name: Run tests
6057
timeout-minutes: 10
61-
run: bundle exec bake test
58+
run: docker-compose -f config/sentinel/docker-compose.yaml up

config/sentinel/docker-compose.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,13 @@ services:
1313
- ./sentinel.conf:/etc/redis/sentinel.conf
1414
depends_on:
1515
- redis-master
16-
- redis-slave
16+
- redis-slave
17+
tests:
18+
image: ruby
19+
volumes:
20+
- ../../:/code
21+
command: bash -c "cd /code && bundle install && bundle exec sus test/async/redis/sentinel_client.rb"
22+
depends_on:
23+
- redis-master
24+
- redis-slave
25+
- redis-sentinel

config/sentinel/environment.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

lib/async/redis/sentinel_client.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def resolve_address
4747
raise ArgumentError, "Unknown instance role #{@role}"
4848
end => address
4949

50+
Console.info(self, "Resolved #{@role} address: #{address}")
51+
5052
address or raise RuntimeError, "Unable to fetch #{@role} via Sentinel."
5153
end
5254

test/async/redis/sentinel_client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
describe Async::Redis::SentinelClient do
1313
include Sus::Fixtures::Async::ReactorContext
1414

15-
let(:master_host) {ENV['ASYNC_REDIS_MASTER']}
16-
let(:slave_host) {ENV['ASYNC_REDIS_SLAVE']}
17-
let(:sentinel_host) {ENV['ASYNC_REDIS_SENTINEL']}
15+
let(:master_host) {"redis://redis-master:6379"}
16+
let(:slave_host) {"redis://redis-slave:6379"}
17+
let(:sentinel_host) {"redis://redis-sentinel:26379"}
1818

1919
let(:sentinels) {[
2020
Async::Redis::Endpoint.parse(sentinel_host)

0 commit comments

Comments
 (0)