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

cli/command/container: set empty args in tests and discard output #5534

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

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

=== 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

- A picture of a cute animal (not mandatory but encouraged)

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]>
@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.67%. Comparing base (21eea1e) to head (b7c142d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5534   +/-   ##
=======================================
  Coverage   60.67%   60.67%           
=======================================
  Files         345      345           
  Lines       23491    23491           
=======================================
  Hits        14252    14252           
  Misses       8266     8266           
  Partials      973      973           

@thaJeztah thaJeztah changed the title cli/command/container: set empty args in tests and discard output Beta cli/command/container: set empty args in tests and discard output Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants