enable running required services via docker-compose
You will still need Ruby, Go, make, Redis, etc. on your development machine.
Using docker-compose to run the Redis servers for the cucumber tests is
not easily achievable, because it would require a docker host network.
Unfortunately this does not work on a Mac.
ADD
docker-compose.yml
+version: '2'
+
+services:
+ mysql:
+ container_name: beetle-mysql
+ image: mysql:5.7
+ ports:
+ - "6612:3306"
+ environment:
+ MYSQL_ALLOW_EMPTY_PASSWORD: 1
+
+ rabbitmq1:
+ container_name: beetle-rabbitmq1
+ image: rabbitmq:3.8-management
+ ports:
+ - "5672:5672"
+ - "15672:15672"
+
+ rabbitmq2:
+ container_name: beetle-rabbitmq2
+ image: rabbitmq:3.8-management
+ ports:
+ - "5673:5672"
+ - "15673:15672"
+
+ consul:
+ container_name: beetle-consul
+ image: consul:1.7.2
+ ports:
+ - "8500:8500"
+ command:
+ agent -dev -node machine -client 0.0.0.0
+
+ redis-master:
+ container_name: beetle-redis-master
+ image: redis:4.0
+ ports:
+ - "6370:6379"
+ volumes:
+ - ./tmp/master-dir:/data
+
+ redis-slave:
+ container_name: beetle-redis-slave
+ image: redis:4.0
+ ports:
+ - "6380:6379"
+ command: redis-server --slaveof beetle-redis-master 6379
+ volumes:
+ - ./tmp/slave-dir:/data
+ depends_on:
+ - redis-master
+
+ # redis-1:
+ # container_name: redis-1
+ # image: redis:4.0
+ # ports:
+ # - "6381:6379"
+ # volumes:
+ # - ./tmp/redis-1:/data
+ # command: redis-server --pidfile redis-1.pid --logfile redis-1.log
+
+ # redis-2:
+ # container_name: redis-2
+ # image: redis:4.0
+ # ports:
+ # - "6382:6379"
+ # volumes:
+ # - ./tmp/redis-2:/data
+ # command: redis-server --pidfile redis-2.pid --logfile redis-2.log
+
+ # redis-3:
+ # container_name: redis-3
+ # image: redis:4.0
+ # ports:
+ # - "6383:6379"
+ # volumes:
+ # - ./tmp/redis-3:/data
+ # command: redis-server --pidfile redis-3.pid --logfile redis-3.log

MODIFY
test/test_helper.rb
test/test_helper.rb
@@ -27,9 +27,13 @@ end
I18n.enforce_available_locales = false
Beetle.config.logger = Logger.new(File.dirname(__FILE__) + '/../test.log')
+if `docker inspect beetle-redis-master -f '{{.State.Status}}'`.chomp == "running"
+ Beetle.config.redis_server = "localhost:6370"
+ Beetle.config.redis_servers = "localhost:6370,localhost:6380"
+else
Beetle.config.redis_server = "localhost:6379"
Beetle.config.redis_servers = "localhost:6379,localhost:6380"
-
+end
def header_with_params(opts = {})
beetle_headers = Beetle::Message.publishing_options(opts)
@@ -46,3 +50,7 @@ def redis_stub(name, opts = {})
opts = {'host' => default_host, 'port' => default_port, 'server' => "#{default_host}:#{default_port}"}.update(opts)
stub(name, opts)
end
+
+if `docker inspect beetle-mysql -f '{{.State.Status}}'`.chomp == "running"
+ ENV['MYSQL_PORT'] = '6612'
+end

enable running required services via docker-compose

You will still need Ruby, Go, make, Redis, etc. on your development machine.
Using docker-compose to run the Redis servers for the cucumber tests is
not easily achievable, because it would require a docker host network.
Unfortunately this does not work on a Mac.