-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test.sh): split it into multiple files
- Loading branch information
Dmitry Kropachev
committed
Jun 11, 2023
1 parent
cfbf0fd
commit 249fecf
Showing
9 changed files
with
106 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
function quit () { | ||
echo $2 | ||
exit $1 | ||
} | ||
|
||
go mod download || quit $? "Downloading dependencies failed" | ||
go install ./... || quit $? "Compilation failed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: '3.5' | ||
|
||
networks: | ||
gemini: | ||
name: gemini | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 192.168.100.0/24 | ||
|
||
services: | ||
gemini-oracle: | ||
image: scylladb/scylla:5.2.2 | ||
container_name: gemini-oracle | ||
command: --smp 1 --memory 128M --api-address 0.0.0.0 | ||
networks: | ||
gemini: | ||
|
||
gemini-test: | ||
image: scylladb/scylla:5.2.2 | ||
container_name: gemini-test | ||
command: --smp 1 --memory 128M --api-address 0.0.0.0 | ||
networks: | ||
gemini: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
docker-compose --log-level WARNING -f scripts/docker-compose-$1.yml up -d | ||
|
||
ORACLE_NAME=gemini-oracle | ||
TEST_NAME=gemini-test | ||
|
||
echo "Waiting for ${ORACLE_NAME} to start" | ||
until docker logs ${ORACLE_NAME} 2>&1 | grep "Starting listening for CQL clients" > /dev/null; do sleep 2; done | ||
echo "Waiting for ${TEST_NAME} to start" | ||
until docker logs ${TEST_NAME} 2>&1 | grep "Starting listening for CQL clients" > /dev/null; do sleep 2; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
ORACLE_NAME=gemini-oracle | ||
TEST_NAME=gemini-test | ||
|
||
ORACLE_IP=$(docker inspect --format='{{ .NetworkSettings.Networks.gemini.IPAddress }}' ${ORACLE_NAME}) | ||
TEST_IP=$(docker inspect --format='{{ .NetworkSettings.Networks.gemini.IPAddress }}' ${TEST_NAME}) | ||
|
||
GEMINI_CMD=gemini | ||
SEED=$(date +%s%N) | ||
ABS_GEMINI_PATH=$(whereis ${GEMINI_CMD}) | ||
ABS_GEMINI_PATH=${ABS_GEMINI_PATH//gemini: /} | ||
|
||
GOBIN="$(dirname $ABS_GEMINI_PATH)" | ||
$GEMINI_CMD \ | ||
--duration=10m \ | ||
--fail-fast \ | ||
--seed=${SEED} \ | ||
--dataset-size=small \ | ||
--test-cluster=${TEST_IP} \ | ||
--oracle-cluster=${ORACLE_IP} \ | ||
"$@" | ||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
test_gemini() { | ||
echo -n "Compile gemini" | ||
./scripts/compile-and-install-gemini.sh || exit 1 | ||
oracle="scylla" | ||
if [ "$1" = "cassandra" ]; then | ||
oracle="cassandra" | ||
shift | ||
fi | ||
|
||
echo -n "Preparing environment with $oracle as oracle" | ||
./scripts/prepare-environment.sh $oracle || exit 1 | ||
|
||
echo -n "Running test with $oracle as oracle for 'gemini $@' ... " | ||
./scripts/run-gemini-test.sh --drop-schema $@ | ||
if [ $? -eq 0 ]; then | ||
echo "OK" | ||
else | ||
echo "FAILED" | ||
fi | ||
|
||
exit $? | ||
} | ||
|
||
test_gemini $@ |