-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-test.sh
executable file
·40 lines (32 loc) · 1.06 KB
/
start-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e
searchEngine=$1
version=$2
# Default Test round: 5x times
rounds=${3:-5}
if [[ "$searchEngine" != "elasticsearch" ]] && [[ "$searchEngine" != "opensearch" ]]; then
echo "First parameter should be SearchEngine-Type: elasticsearch, opensearch !" && exit 1;
fi
if [ -z "$version" ]; then
echo "Second parameter should be SearchEngine-Version (eg. 7.11.2) !" && exit 1;
fi
echo "# Using setup: "
echo " - $searchEngine $version "
echo " - with $rounds test rounds "
echo
# Setting docker env-vars
export ELASTICSEARCH_VERSION_TAG=$version
export OPENSEARCH_VERSION_TAG=$version
echo "# Starting docker-compose ..."
docker-compose -f ./docker/$searchEngine/docker-compose.yml up -d
echo " @Await containers are up & running (10s) ..." && sleep 10
echo ""
echo "# Run performance-test app ($rounds rounds) ..."
for i in $(seq 1 $rounds)
do
./gradlew --quiet run -Psearchengine.provider=$searchEngine -P$searchEngine.version=$version
done
echo ""
echo "# Stopping docker-compose ..."
docker-compose -f ./docker/$searchEngine/docker-compose.yml down
echo ""