From 0990fbb2108f887649798bfeaf92c78fdda7448e Mon Sep 17 00:00:00 2001 From: Nestor Acuna Blanco Date: Wed, 24 Jul 2024 16:36:57 +0200 Subject: [PATCH] fix: make unit-tests can be called more than once In order to run the unit tests multiple times, the kubevirt namespace will be removed before new templates are created. This method ensures that unit tests can be executed successfully, even if the templates already exist in the cluster. If the namespace does not exist, the 'oc delete' command would fail, hence the use of '|| true' to handle this scenario. Signed-off-by: Nestor Acuna Blanco --- automation/unit-tests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automation/unit-tests.sh b/automation/unit-tests.sh index 699fec9a..4dc5059f 100755 --- a/automation/unit-tests.sh +++ b/automation/unit-tests.sh @@ -5,6 +5,8 @@ set -ex templates=$(ls dist/templates/*) namespace="kubevirt" +oc delete namespace ${namespace} || true + echo "Testing fresh installation..." oc apply -f - <