Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker image to run tests #121

Merged
merged 4 commits into from
Mar 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
In Docker testing image, start all services first
This avoid trying to access service while it still starting. This
happened with Redis cluster.
  • Loading branch information
PierreF committed Feb 10, 2021
commit 7b18c44ff1c7f43db4c20b9ae781d2a598c73871
39 changes: 19 additions & 20 deletions run-test-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ service redis-server start

sudo -u mongodb mongod --config /etc/mongod.conf &

mkdir /tmp/cluster-test
cd /tmp/cluster-test
mkdir 7000 7001 7002 7003 7004 7005
cat > 7000/redis.conf << EOF
port 7000
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
EOF

for i in 7001 7002 7003 7004 7005; do
sed s/7000/$i/ < 7000/redis.conf > $i/redis.conf
done

for i in 7000 7001 7002 7003 7004 7005; do
(cd $i; redis-server redis.conf > server.log 2>&1 &)
done

sudo -u postgres psql << "EOF"
create user go_auth_test with login password 'go_auth_test';
create database go_auth_test with owner go_auth_test;
Expand Down Expand Up @@ -56,26 +75,6 @@ ON UPDATE CASCADE
);
EOF


mkdir /tmp/cluster-test
cd /tmp/cluster-test
mkdir 7000 7001 7002 7003 7004 7005
cat > 7000/redis.conf << EOF
port 7000
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
EOF

for i in 7001 7002 7003 7004 7005; do
sed s/7000/$i/ < 7000/redis.conf > $i/redis.conf
done

for i in 7000 7001 7002 7003 7004 7005; do
(cd $i; redis-server redis.conf > server.log 2>&1 &)
done

yes yes | redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 \
127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 \
--cluster-replicas 1
Expand Down