Skip to content

cli/command: minor test-fixes and cleanups #5985

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

Merged
merged 3 commits into from
Apr 4, 2025

Conversation

thaJeztah
Copy link
Member

cli/command: TestHooksEnabled: fix test when config file is present

This test verifies the default behavior, but when running the test
in an environment that already has a ~/.docker/config.json present,
it may fail.

This patch updates the test to configure the config-directory to
point to an empty directory, making sure it's not affected by
state.

cli/command: TestNewDockerCliAndOperators fix unhandled errors

Assert that the write succeeded; also changing Fprintf to Fprint,
because we were not using templating (we should check why no linter
complained about this).

cli/command: use stdlib for temp-dirs

gotest.tools' fs package only provides very minimal benefits here;
use stdlib functions to make things slightly more transparent.

- Human readable description for the release notes

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

Verified

This commit was signed with the committer’s verified signature.
thaJeztah Sebastiaan van Stijn
This test verifies the default behavior, but when running the test
in an environment that already has a ~/.docker/config.json present,
it may fail.

This patch updates the test to configure the config-directory to
point to an empty directory, making sure it's not affected by
state.

Signed-off-by: Sebastiaan van Stijn <[email protected]>

Verified

This commit was signed with the committer’s verified signature.
thaJeztah Sebastiaan van Stijn
Assert that the write succeeded; also changing `Fprintf` to `Fprint`,
because we were not using templating (we should check why no linter
complained about this).

Signed-off-by: Sebastiaan van Stijn <[email protected]>

Verified

This commit was signed with the committer’s verified signature.
thaJeztah Sebastiaan van Stijn
gotest.tools' fs package only provides very minimal benefits here;
use stdlib functions to make things slightly more transparent.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Apr 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.12%. Comparing base (6523832) to head (db44e59).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5985   +/-   ##
=======================================
  Coverage   59.12%   59.12%           
=======================================
  Files         355      355           
  Lines       29740    29740           
=======================================
  Hits        17583    17583           
  Misses      11182    11182           
  Partials      975      975           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thaJeztah thaJeztah requested a review from Benehiko April 4, 2025 15:36
@thaJeztah thaJeztah merged commit 2631d5b into docker:master Apr 4, 2025
96 checks passed
@thaJeztah thaJeztah deleted the command_fix_tests branch April 4, 2025 16:21
@thaJeztah thaJeztah modified the milestones: 28.0.5, 28.1.0 Apr 10, 2025
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.

None yet

3 participants