Skip to content

Commit

Permalink
test: Fix missing artifacts for tests with parentheses
Browse files Browse the repository at this point in the history
When tests with parentheses in their name fail, the artifacts are
missing. This is happening because we run:

    bash -c "zip -qr test_name.zip test_directory"

That therefore fails with:

    /bin/bash: -c: line 0: syntax error near unexpected token `('

We need to add double quotes for this command to work properly with
parentheses.

Fixes: b4bfb40 ("Test: Add test result in Jenkins Junit")
Signed-off-by: Paul Chaignon <paul@cilium.io>
  • Loading branch information
pchaigno committed Jun 16, 2021
1 parent 3c47d70 commit 5527786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ var _ = AfterEach(func() {

_, err := exec.Command(
"/bin/bash", "-c",
fmt.Sprintf("zip -qr %s %s", zipFilePath, path)).CombinedOutput()
fmt.Sprintf("zip -qr \"%s\" \"%s\"", zipFilePath, path)).CombinedOutput()
if err != nil {
log.WithError(err).Errorf("cannot create zip file '%s'", zipFilePath)
}
Expand Down

0 comments on commit 5527786

Please sign in to comment.