Skip to content

Commit

Permalink
fix: make unit-tests can be called more than once
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nestoracunablanco committed Jul 26, 2024
1 parent 004ba06 commit 0990fbb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions automation/unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -ex
templates=$(ls dist/templates/*)
namespace="kubevirt"

oc delete namespace ${namespace} || true

echo "Testing fresh installation..."
oc apply -f - <<EOF
apiVersion: v1
Expand Down

0 comments on commit 0990fbb

Please sign in to comment.