-
Notifications
You must be signed in to change notification settings - Fork 649
[Tigron]: revised Data interface #4081
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
Conversation
57578e8
to
efbdc30
Compare
efbdc30
to
fc0eac2
Compare
f736de3
to
a6e5346
Compare
- fix timeout showing 0s instead of default when no explicit timeout is provided - add actual execution time - fix long logs (stdout, stderr) that were showing only the beginning to also show the end - fix formatting issue for "..." - marginally better output for command contextual information Signed-off-by: apostasie <[email protected]>
Signed-off-by: apostasie <[email protected]>
e32781f
to
7823694
Compare
@@ -44,17 +44,17 @@ func TestBuildContextWithOCILayout(t *testing.T) { | |||
), | |||
Cleanup: func(data test.Data, helpers test.Helpers) { | |||
if nerdtest.IsDocker() { | |||
helpers.Anyhow("buildx", "stop", data.Identifier("-container")) |
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.
Leading dashes are unnecessary. Identifier does separate seed string with dash.
testCase := &test.Case{ | ||
Require: nerdtest.Build, | ||
Cleanup: func(data test.Data, helpers test.Helpers) { | ||
helpers.Anyhow("rmi", "-f", data.Identifier()) | ||
}, |
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.
These (and similar) were doing nothing, as there is no such image.
Failure is #4068 |
|
Many tests require temporary resources (Dockerfiles, compose.yml, etc), and routinely redo the same thing over and over (create separate temp dir, write file, remove temp dir). At best this adds a lot of inconsistent boilerplate / helper functions to the test - at worst, the resources are not properly cleaned-up, or not well isolated from other tests. This PR does introduce a set of helpers to fasttrack temp files manipulation, and rejiggle the Data interface to more clearly separate labels (shared with subtests) and temporary resources. Signed-off-by: apostasie <[email protected]>
Signed-off-by: apostasie <[email protected]>
7823694
to
0d492a2
Compare
data.Labels().Set("net1", data.Identifier("1")) | ||
data.Labels().Set("net2", data.Identifier("2")) | ||
data.Labels().Set("netID1", helpers.Capture("network", "create", "--label="+data.Labels().Get("label"), data.Labels().Get("net1"))) | ||
data.Labels().Set("netID2", helpers.Capture("network", "create", data.Labels().Get("net2"))) |
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.
nit: Labels()
could be just called once
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.
Wondering if the compiler manages to inline that?
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.
Thanks
Blocked by #4111
From testing experience on nerdctl, many tests do require temporary resources (Dockerfiles, compose.yml, etc), and routinely redo the same thing over and over (create separate temp dir, write file, remove temp dir).
At best this adds a lot of boilerplate / helpers functions - at worst, the resources are not properly cleaned-up, or not well isolated from other tests.
The first commit changes the Data interface to allow temp files manipulation (Load, Save, Path, Dir, Exists), and more clearly separates
labels
and temporary resources.The changes in tigron are minimal, but since the interface does change, the second commit does modify all current nerdctl tests that are making use of data labels.
Alongside this, some tests and helpers will now leverage the new temp file manipulation, along with some other minor cleanup in helpers and builder tests.
The PR looks big because of that ^.
Finally note that: