Skip to content
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

Remove temporary image after test run #174

Merged

Conversation

robson90
Copy link
Contributor

@robson90 robson90 commented Feb 3, 2025

Closes: #173

@dasniko dasniko self-requested a review February 3, 2025 17:44
Copy link
Owner

@dasniko dasniko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. First approach. ;)
This removes the named image, but as for each test an image is created with @BeforeEach the first ones become dangling images and won't be removed in the @AfterAll method.
Idea: either create only one image/container and only one test, as in the first 3 test methods, you just start up the same image with no difference and inspect return value and logs. In the 4th method you use a regular container, no custom image.
Or, create a separate image for each test which you remove afterwards again.

Signed-off-by: Robin Meese <[email protected]>
@robson90
Copy link
Contributor Author

robson90 commented Feb 4, 2025

Before Test:
Screenshot 2025-02-04 at 08 23 52

While Test is running:
Screenshot 2025-02-04 at 08 24 03

Some seconds after the Test has finished:
Screenshot 2025-02-04 at 08 24 35

That approach does also work, when Test is failing. I think the "real" problem, is that my test wants to name 3 image the same(paired with the concurrent execution). That is silently failing. If you don't care about the names while running the tests, this solution should be sufficient.

Please let me know, what you think.

Copy link
Owner

@dasniko dasniko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to do the trick

@dasniko dasniko merged commit 8b1f5ff into dasniko:main Feb 4, 2025
1 check passed
@dasniko
Copy link
Owner

dasniko commented Feb 4, 2025

thanks, @robson90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove temporarily created images
2 participants