internal/testutil/daemon.New: cleanup test paths#52311
Merged
thaJeztah merged 1 commit intomoby:masterfrom Apr 7, 2026
Merged
Conversation
ebdf189 to
c05a9a7
Compare
Member
Author
|
AH! Windows ... Windows ... |
remove special characters (like double or single quotes) from name to prevent
creating filesystem paths that can cause errors when parsing through scripts.
Test-names (t.Name()) for sub-tests allow free-form names to be used, for example:
t.Run("engine restart shouldn't kill alive containers", func(t *testing.T) {
Which would result in the quote (') to be included in the filename,
which is valid, but can cause issues when processing with shell scripts;
find bundles -path '*/root/*overlay2' -prune -o -type f \( -name '*-report.json' -o -name '*.log' -o -name '*.out' -o -name '*.prof' -o -name '*-report.xml' \) -print | xargs sudo tar -czf /tmp/reports.tar.gz
[...]
xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option
This patch adds a `sanitizedTestName` utility that replaces special characters
with an underscore to prevent such issues.
Signed-off-by: Sebastiaan van Stijn <[email protected]>
c05a9a7 to
f42ff6a
Compare
AkihiroSuda
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
relates to:
xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option#52300remove special characters (like double or single quotes) from name to prevent creating filesystem paths that can cause errors when parsing through scripts.
Test-names (t.Name()) for sub-tests allow free-form names to be used, for example:
Which would result in the quote (') to be included in the filename, which is valid, but can cause issues when processing with shell scripts;
This patch adds a
sanitizedTestNameutility that replaces special characters with an underscore to prevent such issues.- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)