-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: make unit-tests can be called more than once #594
fix: make unit-tests can be called more than once #594
Conversation
Hi @nestoracunablanco. Thanks for your PR. I'm waiting for a kubevirt member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
Nice catch @nestoracunablanco! These small details are always tricky. |
automation/unit-tests.sh
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would not delete templates which differ from the ones in dist/templates
(see L51). What about deleting the namespace that was created above after a test run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
1aabb6f
to
6c1bf4e
Compare
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 <nestor.acuna@ibm.com>
6c1bf4e
to
0990fbb
Compare
/retest |
3 similar comments
/retest |
/retest |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 0xFelix The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
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.
What this PR does / why we need it: ability to run unit tests consecutively
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Release note: