diff --git a/theodolite-benchmarks/docker-test/README.md b/theodolite-benchmarks/docker-test/README.md index fd1e9bf4730f897273be45a022ad2adeae1b7e6e..3525b2eec1527c3b954b77a2addc28c5bd16ec7d 100644 --- a/theodolite-benchmarks/docker-test/README.md +++ b/theodolite-benchmarks/docker-test/README.md @@ -36,3 +36,13 @@ the host, for example, from the IDE or Gradle. In such cases, the following adju You can now connect to Kafka from your host system with bootstrap server `localhost:19092` and contact the Schema Registry via `localhost:8081`. **Pay attention to the Kafka port, which is *19092* instead of the default one *9092*.** + +## Running Smoke Tests + +The `smoketest-runner.sh` script can be used to run a simple test for a specific Docker Compose file. You can call it with + +```sh +./smoketest-runner.sh <docker-compose-dir> +``` + +where `<docker-compose-dir>` is the directory of a Docker-Compose file, for example, `uc2-beam-samza`. The script exists with a zero exit code in case of success and a non-zero exit code otherwise. diff --git a/theodolite-benchmarks/docker-test/smoketest-runner.sh b/theodolite-benchmarks/docker-test/smoketest-runner.sh new file mode 100755 index 0000000000000000000000000000000000000000..08093d3197dd36e2b4755880360b4ad89a82be92 --- /dev/null +++ b/theodolite-benchmarks/docker-test/smoketest-runner.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +COMPOSE_FILE_PATH=$1 +echo "Run test for '$COMPOSE_FILE_PATH'." + +cd $COMPOSE_FILE_PATH +docker-compose pull +docker-compose up -d kafka zookeeper schema-registry +sleep 10s +docker-compose up -d +sleep 5s +docker-compose ps +sleep 55s +if test -f "./test.sh"; then + ./test.sh + RETURN=$? +else + RETURN=$? + echo "test.sh does not exists for '$COMPOSE_FILE_PATH'." +fi +if [ $RETURN -eq 0 ]; then + echo "Test for '$COMPOSE_FILE_PATH' has passed." +else + echo "Test for '$COMPOSE_FILE_PATH' has failed." +fi + +docker-compose down +exit $RETURN diff --git a/theodolite-benchmarks/docker-test/uc1-beam-flink/test.sh b/theodolite-benchmarks/docker-test/uc1-beam-flink/test.sh new file mode 100755 index 0000000000000000000000000000000000000000..39952ba3943683e94fb2ab0e8965daf440635c29 --- /dev/null +++ b/theodolite-benchmarks/docker-test/uc1-beam-flink/test.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +docker-compose logs --tail 100 benchmark-taskmanager | + sed -n "s/^.*Record:\s\(\S*\)$/\1/p" | + tee /dev/tty | + jq .identifier | + sort | + uniq | + wc -l | + grep "\b10\b" diff --git a/theodolite-benchmarks/docker-test/uc1-beam-samza/test.sh b/theodolite-benchmarks/docker-test/uc1-beam-samza/test.sh new file mode 100755 index 0000000000000000000000000000000000000000..1fdbe9ff938b83335a43ec6862d28e833d2594b2 --- /dev/null +++ b/theodolite-benchmarks/docker-test/uc1-beam-samza/test.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +docker-compose logs --tail 100 benchmark | + sed -n "s/^.*Key:\s\(\S*\), Value:\s\(\S*\).*$/\2/p" | + tee /dev/tty | + jq .identifier | + sort | + uniq | + wc -l | + grep "\b10\b" + + diff --git a/theodolite-benchmarks/docker-test/uc1-flink/test.sh b/theodolite-benchmarks/docker-test/uc1-flink/test.sh new file mode 100755 index 0000000000000000000000000000000000000000..b50d0e6d614387f5755dafb3095d8bcd5f095b51 --- /dev/null +++ b/theodolite-benchmarks/docker-test/uc1-flink/test.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +docker-compose logs --tail 100 benchmark-taskmanager | + sed -n "s/^.*Key:\s\(\S*\), Value:\s\(\S*\).*$/\1 \2/p" | + tee /dev/tty | + awk '{print $1}'| + sort | + uniq | + wc -l | + grep "\b10\b" diff --git a/theodolite-benchmarks/docker-test/uc1-kstreams/test.sh b/theodolite-benchmarks/docker-test/uc1-kstreams/test.sh new file mode 100755 index 0000000000000000000000000000000000000000..c26a28988e3603d08b70fd325a736180b4a04dbb --- /dev/null +++ b/theodolite-benchmarks/docker-test/uc1-kstreams/test.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +docker-compose logs --tail 100 benchmark | + sed -n "s/^.*Record:\s\(\S*\)$/\1/p" | + tee /dev/tty | + jq .identifier | + sort | + uniq | + wc -l | + grep "\b10\b"