Skip to content

Commit

Permalink
add redis test cleanup and set up test replication
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaj committed Feb 5, 2015
1 parent cb58d83 commit 5a93dd3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
23 changes: 21 additions & 2 deletions ci/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,27 @@ def redis_rootdir
Rake::Task['ci:common:run_tests'].invoke(this_provides)
end

task :cleanup => ['ci:common:cleanup']
# FIXME: stop redis
task :cleanup => ['ci:common:cleanup'] do
# Shutdown redis
conf_files = ["#{ENV['TRAVIS_BUILD_DIR']}/ci/resources/redis/auth.conf",
"#{ENV['TRAVIS_BUILD_DIR']}/ci/resources/redis/noauth.conf"]
for f in conf_files do
pass, port = nil, nil
File.readlines(f).each do |line|
param = line.split(' ')
if param[0] == 'port'
port = param[1]
elsif param[0] == 'requirepass'
pass = param[1]
end
end
if pass and port
sh %(#{redis_rootdir}/src/redis-cli -p #{port} -a #{pass} SHUTDOWN)
elsif port
sh %(#{redis_rootdir}/src/redis-cli -p #{port} SHUTDOWN)
end
end
end

task :execute do
exception = nil
Expand Down
1 change: 1 addition & 0 deletions ci/resources/redis/auth.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ pidfile /tmp/dd-redis-auth.pid
bind 127.0.0.1
port 26379
requirepass datadog-is-devops-best-friend
slaveof 127.0.0.1 16379

0 comments on commit 5a93dd3

Please sign in to comment.