From d017a669c54796eb3400e915aa0281d7c093dbc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de>
Date: Mon, 31 Jan 2022 10:33:25 +0100
Subject: [PATCH] Add smoke tests for UC3 (except Flink)

---
 .gitlab-ci.yml                                | 27 +++++++++++++++++++
 .../docker-test/uc3-beam-flink/test.sh        |  9 +++++++
 .../docker-test/uc3-beam-samza/test.sh        |  9 +++++++
 .../docker-test/uc3-kstreams/test.sh          |  9 +++++++
 4 files changed, 54 insertions(+)
 create mode 100755 theodolite-benchmarks/docker-test/uc3-beam-flink/test.sh
 create mode 100755 theodolite-benchmarks/docker-test/uc3-beam-samza/test.sh
 create mode 100755 theodolite-benchmarks/docker-test/uc3-kstreams/test.sh

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0bd7e31a9..a8cf4930e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -464,6 +464,33 @@ smoketest-uc2-beam-samza:
     DOCKER_COMPOSE_DIR: "uc2-beam-samza"
     JAVA_PROJECT_DEPS: "uc2-beam-samza,uc2-beam,beam-commons,uc2-load-generator,load-generator-commons"
 
+smoketest-uc3-kstreams:
+  extends: .smoketest-benchmarks
+  needs:
+    - deploy-uc3-kstreams
+    - deploy-uc3-load-generator
+  variables:
+    DOCKER_COMPOSE_DIR: "uc3-kstreams"
+    JAVA_PROJECT_DEPS: "uc3-kstreams,kstreams-commons,uc3-load-generator,load-generator-commons"
+
+smoketest-uc3-beam-flink:
+  extends: .smoketest-benchmarks
+  needs:
+    - deploy-uc2-beam-flink
+    - deploy-uc2-load-generator
+  variables:
+    DOCKER_COMPOSE_DIR: "uc2-beam-flink"
+    JAVA_PROJECT_DEPS: "uc2-beam-flink,uc2-beam,beam-commons,uc2-load-generator,load-generator-commons"
+
+smoketest-uc3-beam-samza:
+  extends: .smoketest-benchmarks
+  needs:
+    - deploy-uc2-beam-samza
+    - deploy-uc2-load-generator
+  variables:
+    DOCKER_COMPOSE_DIR: "uc2-beam-samza"
+    JAVA_PROJECT_DEPS: "uc2-beam-samza,uc2-beam,beam-commons,uc2-load-generator,load-generator-commons"
+
 
 # Theodolite Framework
 
diff --git a/theodolite-benchmarks/docker-test/uc3-beam-flink/test.sh b/theodolite-benchmarks/docker-test/uc3-beam-flink/test.sh
new file mode 100755
index 000000000..a9b5d5e48
--- /dev/null
+++ b/theodolite-benchmarks/docker-test/uc3-beam-flink/test.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+docker-compose exec kcat kcat -C -b kafka:9092 -t output -s key=s -s value=s -r http://schema-registry:8081 -f '%k:%s\n' -c 600 |
+    tee /dev/stderr |
+    awk -F ':' '!/^%/ {print $1}' |
+    sort |
+    uniq |
+    wc -l |
+    grep "\b10\b"
diff --git a/theodolite-benchmarks/docker-test/uc3-beam-samza/test.sh b/theodolite-benchmarks/docker-test/uc3-beam-samza/test.sh
new file mode 100755
index 000000000..a9b5d5e48
--- /dev/null
+++ b/theodolite-benchmarks/docker-test/uc3-beam-samza/test.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+docker-compose exec kcat kcat -C -b kafka:9092 -t output -s key=s -s value=s -r http://schema-registry:8081 -f '%k:%s\n' -c 600 |
+    tee /dev/stderr |
+    awk -F ':' '!/^%/ {print $1}' |
+    sort |
+    uniq |
+    wc -l |
+    grep "\b10\b"
diff --git a/theodolite-benchmarks/docker-test/uc3-kstreams/test.sh b/theodolite-benchmarks/docker-test/uc3-kstreams/test.sh
new file mode 100755
index 000000000..a9b5d5e48
--- /dev/null
+++ b/theodolite-benchmarks/docker-test/uc3-kstreams/test.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+docker-compose exec kcat kcat -C -b kafka:9092 -t output -s key=s -s value=s -r http://schema-registry:8081 -f '%k:%s\n' -c 600 |
+    tee /dev/stderr |
+    awk -F ':' '!/^%/ {print $1}' |
+    sort |
+    uniq |
+    wc -l |
+    grep "\b10\b"
-- 
GitLab