Skip to content

Commit c937883

Browse files
remibcursoragent
andcommitted
JGC-449 - Suppress gosec G101 and G703 in test files
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 47118b1 commit c937883

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

utils/io/fileutils/temp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func TestCleanOldDirsContinuesOnError(t *testing.T) {
140140
_, err1 := os.Stat(validFile1Name)
141141
assert.True(t, os.IsNotExist(err1), "validFile1 should be deleted")
142142

143-
_, err2 := os.Stat(validFile2Name)
143+
_, err2 := os.Stat(validFile2Name) // #nosec G703 -- test file; path from test temp dir
144144
assert.True(t, os.IsNotExist(err2), "validFile2 should be deleted")
145145

146146
// Invalid file should still exist (couldn't be processed)

utils/regexputils_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ func TestReturnErrorOnNotFound(t *testing.T) {
7070
regex gofrogio.CmdOutputPattern
7171
error bool
7272
}{
73-
{"Without Error", gofrogio.CmdOutputPattern{RegExp: regExpProtocol, Line: "go: github.com/jfrog/jfrog-client-go@v0.2.1: This is an example line http://user:password@127.0.0.1:8081/artifactory/path/to/repo"}, false},
74-
{"With Error No Response Message", gofrogio.CmdOutputPattern{RegExp: regExpProtocol, Line: "go: github.com/jfrog/jfrog-client-go@v0.2.1: This is an example line http://user:password@127.0.0.1:8081/artifactory/path/to/repo: 404"}, true},
75-
{"With Error With response message", gofrogio.CmdOutputPattern{RegExp: regExpProtocol, Line: "go: github.com/jfrog/jfrog-client-go@v0.2.1: This is an example line http://user:password@127.0.0.1:8081/artifactory/path/to/repo: 404 Not Found"}, true},
73+
{"Without Error", gofrogio.CmdOutputPattern{RegExp: regExpProtocol, Line: "go: github.com/jfrog/jfrog-client-go@v0.2.1: This is an example line http://user:password@127.0.0.1:8081/artifactory/path/to/repo"}, false}, // #nosec G101 -- test data: fake URL for regex matching
74+
{"With Error No Response Message", gofrogio.CmdOutputPattern{RegExp: regExpProtocol, Line: "go: github.com/jfrog/jfrog-client-go@v0.2.1: This is an example line http://user:password@127.0.0.1:8081/artifactory/path/to/repo: 404"}, true}, // #nosec G101 -- test data: fake URL for regex matching
75+
{"With Error With response message", gofrogio.CmdOutputPattern{RegExp: regExpProtocol, Line: "go: github.com/jfrog/jfrog-client-go@v0.2.1: This is an example line http://user:password@127.0.0.1:8081/artifactory/path/to/repo: 404 Not Found"}, true}, // #nosec G101 -- test data: fake URL for regex matching
7676
{"On Different Message", gofrogio.CmdOutputPattern{RegExp: regExpProtocol, Line: "go: finding github.com/elazarl/go-bindata-assetfs v0.0.0-20151224045452-57eb5e1fc594"}, false},
7777
}
7878
for _, test := range tests {

0 commit comments

Comments
 (0)