-
Notifications
You must be signed in to change notification settings - Fork 609
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
TestBuildIsShareableForCompatiblePlatform unclear what the intent is #3451
Comments
I will assume this was meant to test building for a "different from the host but currently emulated platform", and rewrite the test accordingly, including verification that we are able to emulate. |
i can fix it, AssertErrNotContains -> from the name i always assumed it checks stderr, probably a simple redirection of everything to stdout would fix it. the test checks if a cross build is happening then a tarball is created. so if the test are running on amd then that portion would run and test but if its running on arm it would get skipped. |
Probably this method should go. It does not really serve a purpose, since what we are checking here is that the build is successful (exitcode 0 should be sufficient).
This is not what is happening right now. |
-thats not entirely correct, we are checking if the build was successful and export of the image is not a tarball for cases where we are not doing a cross platform build. yeah agreed removing hardcoded stuff, not sure about a good way to test it out, let me check. |
Besides the fact that currently it is testing stdout instead of stderr - I don't think the above is accurate:
Either way, no point in rehashing this - appreciate if you can fix it :-) Thanks @Shubhranshu153 |
i see thanks, will update it to test it accurately. |
Checked it again, i think we can remove the test creating a pr. Technically the unit test for this cover the different cases for the function itself. But here is what my test outputs are, so if the platform matches or i dont give platform the tarball is not created, just curious whats your setup to be able to reproduce it, in the grand scheme of things i had thought this behaviour would be consistent in any system
|
I am on lima on an M2 - containerd v2.0.0-rc.3 - nerdctl main. Not sure what the (other) differences could be here?
That, or we clarify what the intention of the test was.
|
checked with containerd v2.0.0-rc.4-56-ga44804738 -nerdctl main, my results were same,
|
this is the pr: #3456 |
PR removed this test, so, closing. |
Description
TestBuildIsShareableForCompatiblePlatform
relies onAssertErrNotContains
, which apparently does not test stderr, but stdout.Since there is never anything on stdout in that case, none of these asserts are doing anything.
Furthermore, the test on a different architecture will only pass if emulation is enabled, but fail otherwise.
Put otherwise, the test right now is doing two things:
It is unclear to me what the test intent is.
Can we clarify?
Thanks.
Tagging @Shubhranshu153
Steps to reproduce the issue
na
Describe the results you received and expected
na
What version of nerdctl are you using?
main
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
None
Host information
No response
The text was updated successfully, but these errors were encountered: