Skip to content

Commit b521ed4

Browse files
authored
[builder] fix the TestGenerateInvalidOutputPath (#10595)
If the test is executed with the `root` user, the `TestGenerateInvalidOutputPath` test fails. The behaviour was noticed with a GitLab runner that was executed with root rights. An attempt is made to create the directory `/:invalid` during the test. A user without root rights receives the message `cannot create directory '/:invalid': Permission denied`. In contrast, the `root` user can create the directory without any problems because this is a valid path. To correct the behaviour of the test, the path to `:/invalid` was adjusted. This is not a valid path under Windows or Linux. Signed-off-by: Andrej Giesbrecht <[email protected]>
1 parent 2c9229d commit b521ed4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/builder/internal/builder/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestGenerateDefault(t *testing.T) {
112112

113113
func TestGenerateInvalidOutputPath(t *testing.T) {
114114
cfg := newInitializedConfig(t)
115-
cfg.Distribution.OutputPath = "/:invalid"
115+
cfg.Distribution.OutputPath = ":/invalid"
116116
err := Generate(cfg)
117117
require.Error(t, err)
118118
require.Contains(t, err.Error(), "failed to create output path")

0 commit comments

Comments
 (0)