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
To enable running the unit tests multiple times, the existing
templates are deleted before creating new ones. This approach
allows for the successful execution of unit tests even if the
templates already exist in the cluster.

If the templates do not exist, the 'oc delete' command would fail,
which is why '|| true' is used.

Signed-off-by: Nestor Acuna Blanco <nestor.acuna@ibm.com>
  • Loading branch information
nestoracunablanco committed Jul 26, 2024
1 parent 004ba06 commit 1aabb6f
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 @@ -25,6 +25,8 @@ for template in $templates; do
oc process -f "$template" NAME=test DATA_SOURCE_NAME=test || exit 1
done

echo "generate all templates after cleaning up first"
oc delete -f dist/templates || true
oc create -f dist/templates

#check validation part
Expand Down

0 comments on commit 1aabb6f

Please sign in to comment.