From 23b70cbf7bccb99c41768aa192b6e471b1631bcd Mon Sep 17 00:00:00 2001
From: Victor Kotlyar <Victor.Kotlyar@cern.ch>
Date: Thu, 20 Jun 2019 11:19:30 +0200
Subject: [PATCH] Make gitlab CI tests stop after catalogue verification
 errors.

---
 continuousintegration/orchestration/tests/archive_retrieve.sh | 4 ++++
 continuousintegration/orchestration/tests/prepare_tests.sh    | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/continuousintegration/orchestration/tests/archive_retrieve.sh b/continuousintegration/orchestration/tests/archive_retrieve.sh
index 4bca61163a..f1660edd32 100755
--- a/continuousintegration/orchestration/tests/archive_retrieve.sh
+++ b/continuousintegration/orchestration/tests/archive_retrieve.sh
@@ -29,6 +29,10 @@ fi
 
 echo "Preparing namespace for the tests"
 ./prepare_tests.sh -n ${NAMESPACE}
+if [ $? -ne 0 ]; then
+  echo "ERROR: failed to prepare namespace for the tests"
+  exit 1
+fi
 
 echo
 echo "Launching simple_client_ar.sh on client pod"
diff --git a/continuousintegration/orchestration/tests/prepare_tests.sh b/continuousintegration/orchestration/tests/prepare_tests.sh
index d2472bd257..a5571eca25 100755
--- a/continuousintegration/orchestration/tests/prepare_tests.sh
+++ b/continuousintegration/orchestration/tests/prepare_tests.sh
@@ -67,6 +67,10 @@ NB_TAPEDRIVES_IN_USE=${#TAPEDRIVES_IN_USE[@]}
 echo "Preparing CTA configuration for tests"
   # verify the catalogue DB schema
     kubectl --namespace ${NAMESPACE} exec ctafrontend -- cta-catalogue-schema-verify /etc/cta/cta-catalogue.conf
+    if [ $? -ne 0 ]; then
+      echo "ERROR: failed to verify the catalogue DB schema"
+      exit 1
+    fi
   kubectl --namespace ${NAMESPACE} exec ctafrontend -- cta-catalogue-admin-user-create /etc/cta/cta-catalogue.conf --username ctaadmin1 -m "docker cli"
   for ((i=0; i<${#TAPEDRIVES_IN_USE[@]}; i++)); do
     kubectl --namespace ${NAMESPACE} exec ctacli -- cta-admin logicallibrary add \
-- 
GitLab