Add new k6 test profile for running edurance tests
- assign a profile name to the existing k6 tests (kpi)
- add control which profile is run using k6 config file
- both test profiles can run in parallel
Issue-ID: CPS-2464
Change-Id: I9fea13f12e2da46bd55b4315c68209843c1abe06
Signed-off-by: halil.cakal <halil.cakal@est.tech>
diff --git a/k6-tests/setup.sh b/k6-tests/setup.sh
index a4508e1..c794c64 100755
--- a/k6-tests/setup.sh
+++ b/k6-tests/setup.sh
@@ -15,14 +15,20 @@
# limitations under the License.
#
-docker-compose -f ../docker-compose/docker-compose.yml --profile dmi-stub up --quiet-pull -d
+testProfile=$1
+echo "Spinning off the CPS and NCMP containers for $testProfile testing..."
+
+if [[ "$testProfile" == "endurance" ]]; then
+ docker-compose -f ../docker-compose/docker-compose.yml --profile dmi-stub --project-name "$testProfile" --env-file ../docker-compose/config/endurance.env up --quiet-pull -d
+ CONTAINER_IDS=$(docker ps --filter "name=endurance-cps-and-ncmp" --format "{{.ID}}")
+else
+ docker-compose -f ../docker-compose/docker-compose.yml --profile dmi-stub --project-name "$testProfile" up --quiet-pull -d
+ CONTAINER_IDS=$(docker ps --filter "name=kpi-cps-and-ncmp" --format "{{.ID}}")
+fi
echo "Waiting for CPS to start..."
READY_MESSAGE="Inventory Model updated successfully"
-# Get the container IDs of the cps-and-ncmp replicas
-CONTAINER_IDS=$(docker ps --filter "name=cps-and-ncmp" --format "{{.ID}}")
-
# Check the logs for each container
for CONTAINER_ID in $CONTAINER_IDS; do
echo "Checking logs for container: $CONTAINER_ID"