fix(test): only clean up containers created by image tests#51
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRestricts integration test container cleanup to only test-owned containers and exports the populator container name prefix for reuse, while centralizing the verify-container name into a constant. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
| _ = podmanClient.ContainerRemove(ctx, name, true) | ||
| // Only remove containers created by this test suite, | ||
| // never touch user containers. | ||
| if strings.HasPrefix(name, cluster.PopulatorContainerNamePrefix+"-") || name == verifyContainerName { |
There was a problem hiding this comment.
Many thanks for the fix. Any chance to relay in labels instead of the container name? We can also add a label for the populator if it is missing
There was a problem hiding this comment.
Thanks for the suggestion, I've refactored the logic to rely on labels instead.
|
Thanks for the PR the changes look good. Unfortunately, there is an issue with the CI I'm currently looking and trying to solve |
|
can you please rebase? |
|
@zdyxry could you also please squash the 2 commit into a single one? |
- Add bink.component label to cluster-images-populator containers - Add bink.component label to cluster-images-test-verify containers - Filter test-owned containers by label in BeforeEach/AfterEach - Unexport PopulatorContainerNamePrefix (no longer needed by tests)
|
@alicefr Hi, I've rebased and squash commit, wait for the CI results. |
Summary by Sourcery
Limit image integration test container cleanup to test-owned containers and expose shared container naming for reuse.
Bug Fixes:
Enhancements:
Tests: