Repository navigation
Upgrade tests - properly clean up resources - #12395
Conversation
* clean the services within Golang test, either in post-upgrade or post-downgrade test if it is executed * re-use code from updateService function in servicePostDowngrade test
Codecov Report
@@ Coverage Diff @@
## main #12395 +/- ##
==========================================
+ Coverage 87.43% 87.45% +0.02%
==========================================
Files 195 195
Lines 9655 9655
==========================================
+ Hits 8442 8444 +2
+ Misses 930 928 -2
Partials 283 283
Continue to review full report at Codecov.
|
1453c19 to
78adaf9
Compare
|
/retest |
|
Should we verify that nothing is left somehow? |
You mean verify that after running the tests nothing is left in the test namespace? I manually checked this when I implemented these changes (in previous runs of CI). If you're talking about permanent check, I'm not sure it's necessary to pollute the scripts with that. We don't do that in other test suites either, AFAIK. |
|
Thanks for the clarification @mgencur. Yeah just wanted to verify somehow the outcome of this patch. Could you also update the title (s/preperly/properly)? |
|
@skonto Updated. |
| func CreateNewServicePostDowngradeTest() pkgupgrade.Operation { | ||
| return pkgupgrade.NewOperation("CreateNewServicePostDowngradeTest", func(c pkgupgrade.Context) { | ||
| createNewService(postDowngradeServiceName, c.T) | ||
| createNewService("pizzaplanet-post-downgrade-service", c.T) |
There was a problem hiding this comment.
Because it is used only in a single place. The const also doesn't make it clearer what this means because the name of the const was nearly the same as the string.
There was a problem hiding this comment.
On the one hand placing the const side by side with the others is nice (you see all constants in one place) but on the other hand when you're looking at this test you need to also look in the other place to find out what the string is. But I don't have a strong opinion on this.
| func CreateNewServicePostUpgradeTest() pkgupgrade.Operation { | ||
| return pkgupgrade.NewOperation("CreateNewServicePostUpgradeTest", func(c pkgupgrade.Context) { | ||
| createNewService(postUpgradeServiceName, c.T) | ||
| createNewService("pizzaplanet-post-upgrade-service", c.T) |
There was a problem hiding this comment.
same question, why not use the const?
There was a problem hiding this comment.
Because it is used only in a single place.
There was a problem hiding this comment.
I think it is fine to remove the constant. Since it is used in one place and its value suffix documents its usage there is no reason to make it a global constant (although not bad for Golang either). The name of the service seems more of a detail to me. What matters in this context is the operation CreateNewServicePostUpgradeTest, unless I miss something here.
|
/lgtm |
|
/cc @dprotaso for approval and last minute check. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, mgencur The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Ensure service cleanup in upgrade tests * clean the services within Golang test, either in post-upgrade or post-downgrade test if it is executed * re-use code from updateService function in servicePostDowngrade test * Fix service names in ScaleToZero post upgrade test
…#12395) (#1046) * Upgrade tests - properly clean up resources (knative#12395) * Ensure service cleanup in upgrade tests * clean the services within Golang test, either in post-upgrade or post-downgrade test if it is executed * re-use code from updateService function in servicePostDowngrade test * Fix service names in ScaleToZero post upgrade test * Call create_namespaces with arg SYSTEM_NAMESPACES (#1025) * This is required after merging https://github.com/openshift-knative/serverless-operator/commit/c76313f15a3a612a1a38b812dcfa8f688fdf00c6#diff-051375546db9782[…]3dd8634ca5b2c8968bb8 which separates system and test namespaces, so it is required to choose system ns
Fixes #12400
Proposed Changes
Release Note