-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
cli/command/container: set empty args in tests and discard output #5534
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5534 +/- ##
==========================================
+ Coverage 60.53% 60.92% +0.39%
==========================================
Files 342 345 +3
Lines 23483 23491 +8
==========================================
+ Hits 14216 14313 +97
+ Misses 8292 8205 -87
+ Partials 975 973 -2 |
cli/command/container/utils_test.go
Outdated
for _, tc := range tests { | ||
t.Run(tc.cid, func(t *testing.T) { | ||
client := &fakeClient{waitFunc: waitFn, Version: api.DefaultVersion} | ||
|
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.
It's now using a separate client per test – was that an intentional change?
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.
Good catch; not really (I think I contemplated "parallel" tests for a second, but the overhead thereof didn't make much sense for this).
Let me change that back
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.
@laurazard updated; PTAL
Prevent some tests from failing when running from a pre-compiled testbinary, and discard output to make the output less noisy. Signed-off-by: Sebastiaan van Stijn <[email protected]>
=== RUN TestWaitExitOrRemoved === RUN TestWaitExitOrRemoved/normal-container === RUN TestWaitExitOrRemoved/give-me-exit-code-42 === RUN TestWaitExitOrRemoved/i-want-a-wait-error time="2024-10-13T18:48:14+02:00" level=error msg="Error waiting for container: removal failed" === RUN TestWaitExitOrRemoved/non-existent-container-id time="2024-10-13T18:48:14+02:00" level=error msg="error waiting for container: no such container: non-existent-container-id" --- PASS: TestWaitExitOrRemoved (0.00s) --- PASS: TestWaitExitOrRemoved/normal-container (0.00s) --- PASS: TestWaitExitOrRemoved/give-me-exit-code-42 (0.00s) --- PASS: TestWaitExitOrRemoved/i-want-a-wait-error (0.00s) --- PASS: TestWaitExitOrRemoved/non-existent-container-id (0.00s) PASS Signed-off-by: Sebastiaan van Stijn <[email protected]>
b7c142d
to
35d7b1a
Compare
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.
LGTM
cli/command/container: set empty args in tests and discard output
Prevent some tests from failing when running from a pre-compiled testbinary, and discard output to make the output less noisy.
cli/command/container: TestWaitExitOrRemoved use subtests
- A picture of a cute animal (not mandatory but encouraged)