Skip to content

Commit

Permalink
Add old redis container for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Nov 11, 2022
1 parent 786dbd1 commit 0572b49
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ test_containers:
# issue when you connect to the testing container via ssh, then try lowering this file a notch.
GRPC_RUBY_BUILD_PROCS: 6
DD_INSTRUMENTATION_TELEMETRY_ENABLED: false
TEST_REDIS_OLD_HOST: redis_old
- &container_parameters_environment
- *container_base_environment
- TEST_DATADOG_INTEGRATION: 1
Expand Down Expand Up @@ -78,6 +79,10 @@ test_containers:
- &container_redis
image: redis:6.2
- &redis_port 6379
- &container_redis_old
image: redis:3.0
name: redis_old
- &redis_old_port 6379
- &container_mongo
image: mongo:3.5
- &mongo_port 27017
Expand Down Expand Up @@ -261,6 +266,7 @@ orbs:
- *container_mysql
- *container_elasticsearch
- *container_redis
- *container_redis_old
- *container_mongo
- *container_memcached
- *container_agent
Expand Down Expand Up @@ -288,6 +294,8 @@ orbs:
port: *elasticsearch_port
- docker-wait:
port: *redis_port
- docker-wait:
port: *redis_old_port
- docker-wait:
port: *mongo_port
- docker-wait:
Expand Down
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ TEST_PRESTO_HOST=localhost
TEST_PRESTO_PORT=8080
TEST_REDIS_HOST=127.0.0.1
TEST_REDIS_PORT=6379
TEST_REDIS_OLD_HOST=127.0.0.1
TEST_REDIS_OLD_PORT=6380
57 changes: 57 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -27,6 +28,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -47,6 +50,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -60,6 +64,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -80,6 +86,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -93,6 +100,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -113,6 +122,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -126,6 +136,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -146,6 +158,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -159,6 +172,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -179,6 +194,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -192,6 +208,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -212,6 +230,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -225,6 +244,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -244,6 +265,7 @@ services:
- mysql
- postgres
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -255,6 +277,8 @@ services:
- TEST_MYSQL_HOST=mysql
- TEST_POSTGRES_HOST=postgres
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -273,6 +297,7 @@ services:
- mysql
- postgres
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -284,6 +309,8 @@ services:
- TEST_MYSQL_HOST=mysql
- TEST_POSTGRES_HOST=postgres
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -303,6 +330,7 @@ services:
- mysql
- postgres
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -314,6 +342,8 @@ services:
- TEST_MYSQL_HOST=mysql
- TEST_POSTGRES_HOST=postgres
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -332,6 +362,7 @@ services:
- mysql
- postgres
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -343,6 +374,8 @@ services:
- TEST_MYSQL_HOST=mysql
- TEST_POSTGRES_HOST=postgres
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -362,6 +395,7 @@ services:
- mysql
- postgres
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -373,6 +407,8 @@ services:
- TEST_MYSQL_HOST=mysql
- TEST_POSTGRES_HOST=postgres
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -391,6 +427,7 @@ services:
- mysql
- postgres
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -402,6 +439,8 @@ services:
- TEST_MYSQL_HOST=mysql
- TEST_POSTGRES_HOST=postgres
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -424,6 +463,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -437,6 +477,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -456,6 +498,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -469,6 +512,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -488,6 +533,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -501,6 +547,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand All @@ -521,6 +569,7 @@ services:
- postgres
- presto
- redis
- redis_old
env_file: ./.env
environment:
- BUNDLE_GEMFILE=/app/Gemfile
Expand All @@ -534,6 +583,8 @@ services:
- TEST_PRESTO_HOST=presto
- TEST_PRESTO_PORT=8080
- TEST_REDIS_HOST=redis
- TEST_REDIS_OLD_HOST=redis_old
- TEST_REDIS_OLD_PORT=6379
stdin_open: true
tty: true
volumes:
Expand Down Expand Up @@ -616,6 +667,12 @@ services:
- "6379"
ports:
- "${TEST_REDIS_PORT}:6379"
redis_old:
image: redis:3.0
expose:
- "6379"
ports:
- "${TEST_REDIS_OLD_PORT}:6379"
volumes:
bundle-2.1:
bundle-2.2:
Expand Down
5 changes: 3 additions & 2 deletions spec/datadog/tracing/contrib/qless/support/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ def string
RSpec.shared_context 'Qless job' do
include Qless::WorkerHelpers

let(:host) { ENV.fetch('TEST_REDIS_HOST', '127.0.0.1') }
let(:port) { ENV.fetch('TEST_REDIS_PORT', 6379) }
let(:host) { ENV.fetch('TEST_REDIS_OLD_HOST', '127.0.0.1') }
let(:port) { ENV.fetch('TEST_REDIS_OLD_PORT', 6379) }

let(:client) { Qless::Client.new(host: host, port: port) }
let(:queue) { client.queues['main'] }
let(:reserver) { Qless::JobReservers::Ordered.new([queue]) }
Expand Down

0 comments on commit 0572b49

Please sign in to comment.