Skip to content

volume/mounts: minor linting issues, touch-ups, and improve test-coverage#48776

Merged
thaJeztah merged 6 commits intomoby:masterfrom
thaJeztah:mount_improve_tests
Oct 28, 2024
Merged

volume/mounts: minor linting issues, touch-ups, and improve test-coverage#48776
thaJeztah merged 6 commits intomoby:masterfrom
thaJeztah:mount_improve_tests

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

volume/mounts: windowsParser.ConvertTmpfsOptions don't use runtime.GOOS

These parsers can be compiled and used cross-platform, but follow platform-
specific semantics. Remove the use of runtime.GOOS, as it would result in
confusing errors ("linux does not support tmpfs").

volume/mounts: windowsParser.ConvertTmpfsOptions don't use runtime.GOOS

volumes/mounts: remove backticks from errors

These errors used a backtick, which is not commonly used in our errors.
Change them to use single quotes instead.

volumes/mounts: remove backticks from test logs

volumes/mounts: don't set "expected" values for fail cases

ParseMountRaw returns a nil value on error, so there's nothing to
check other than it not returning a value.

volumes/mounts: test the actual error returned

Update the tests to have a match for the actual error string returned.

volumes/mounts: test the actual MountConfig returned

Make sure we're asserting the right fields to be propagated, as there
are some fields that shadow top-level fields (by design).

- Description for the changelog

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

These parsers can be compiled and used cross-platform, but follow platform-
specific semantics. Remove the use of runtime.GOOS, as it would result in
confusing errors ("linux does not support tmpfs").

Signed-off-by: Sebastiaan van Stijn <[email protected]>
These errors used a backtick, which is not commonly used in our errors.
Change them to use single quotes instead.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
ParseMountRaw returns a nil value on error, so there's nothing to
check other than it not returning a value.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Update the tests to have a match for the actual error string returned.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added this to the 28.0.0 milestone Oct 27, 2024
@thaJeztah thaJeztah self-assigned this Oct 27, 2024
Make sure we're asserting the right fields to be propagated, as there
are some fields that shadow top-level fields (by design).

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the mount_improve_tests branch from f41b242 to 3188079 Compare October 27, 2024 20:51
@thaJeztah
Copy link
Copy Markdown
Member Author

Thx! Let me bring this one in; there's more I want to look at in this package, as there's some gnarly bits, but having more coverage helps verifying changes.

@thaJeztah thaJeztah merged commit 5f0f32b into moby:master Oct 28, 2024
@thaJeztah thaJeztah deleted the mount_improve_tests branch October 28, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants