Skip to content
Snippets Groups Projects
Commit a1b02f0b authored by Sören Henning's avatar Sören Henning
Browse files

Add test runner and tests for UC1

parent ce66fba7
No related branches found
No related tags found
1 merge request!232Add smoke tests for benchmark
Pipeline #6243 canceled
......@@ -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.
#!/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
#!/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"
#!/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"
#!/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"
#!/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"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment