-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/govulncheck: make test case config data
Instead of listing test cases and their configuration in the unit test, we now make the configuration part of the test case, merging it with fixups. This allows us to enumerate test cases instead of listing them explicitly in main_test.go. Change-Id: I75448553035746cd9eb21e6cdc01bae7f13c2327 Reviewed-on: https://go-review.googlesource.com/c/vuln/+/574936 LUCI-TryBot-Result: Go LUCI <[email protected]> Run-TryBot: Zvonimir Pavlinovic <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Maceo Thompson <[email protected]>
- Loading branch information
1 parent
7838670
commit efaa3ce
Showing
8 changed files
with
151 additions
and
144 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"fixups": [ | ||
{ | ||
"pattern": "Scanning your code and (\\d+) packages across (\\d+)", | ||
"replace": "Scanning your code and P packages across M" | ||
}, | ||
{ | ||
"pattern": "Scanner: govulncheck@v.*", | ||
"replace": "Scanner: [email protected]" | ||
}, | ||
{ | ||
"pattern": "\"([^\"]*\") is a file", | ||
"replace": "govulncheck: myfile is a file" | ||
}, | ||
{ | ||
"pattern": "\"scanner_version\": \"[^\"]*\"", | ||
"replace": "\"scanner_version\": \"v0.0.0-00000000000-20000101010101\"" | ||
}, | ||
{ | ||
"pattern": "file:///(.*)/testdata/(.*)/vulndb", | ||
"replace": "testdata/vulndb" | ||
}, | ||
{ | ||
"pattern": "package (.*) is not in (GOROOT|std) (.*)", | ||
"replace": "package foo is not in GOROOT (/tmp/foo)" | ||
}, | ||
{ | ||
"pattern": "modified (.*)\\)", | ||
"replace": "modified 01 Jan 21 00:00 UTC)" | ||
}, | ||
{ | ||
"pattern": "Go: (go1.[\\.\\d]*|devel).*", | ||
"replace": "Go: go1.18" | ||
}, | ||
{ | ||
"pattern": "\"go_version\": \"go[^\\s\"]*\"", | ||
"replace": "\"go_version\": \"go1.18\"" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"copy": true, | ||
"skipBuild": true | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"fixups": [ | ||
{ | ||
"pattern": "\\.go:(\\d+):(\\d+):", | ||
"replace": ".go:\u003cl\u003e:\u003cc\u003e:", | ||
"comment": " mask line and column with <l> and <c> placeholders, resp." | ||
}, | ||
{ | ||
"pattern": "\\\"line\\\":(\\s)*(\\d+)", | ||
"replace": "\"line\": \u003cl\u003e", | ||
"comment": "modify position lines in json" | ||
}, | ||
{ | ||
"pattern": "\\\"column\\\":(\\s)*(\\d+)", | ||
"replace": "\"column\": \u003cc\u003e", | ||
"comment": "modify position columns in json" | ||
}, | ||
{ | ||
"pattern": "\\\"offset\\\":(\\s)*(\\d+)", | ||
"replace": "\"offset\": \u003co\u003e", | ||
"comment": "modify position offsets in json" | ||
}, | ||
{ | ||
"pattern": "Scanning your code and (\\d+) packages across (\\d+)", | ||
"replace": "Scanning your code and P packages across M" | ||
}, | ||
{ | ||
"pattern": "Scanner: govulncheck@v.*", | ||
"replace": "Scanner: [email protected]" | ||
}, | ||
{ | ||
"pattern": "\"scanner_version\": \"[^\"]*\"", | ||
"replace": "\"scanner_version\": \"v0.0.0-00000000000-20000101010101\"" | ||
}, | ||
{ | ||
"pattern": "file:///(.*)/testdata/(.*)/vulndb", | ||
"replace": "testdata/vulndb" | ||
}, | ||
{ | ||
"pattern": "modified (.*)\\)", | ||
"replace": "modified 01 Jan 21 00:00 UTC)" | ||
}, | ||
{ | ||
"pattern": "\"go_version\": \"go[^\\s\"]*\"", | ||
"replace": "\"go_version\": \"go1.18\"" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"strip": true, | ||
"skipGOOS": ["darwin"] | ||
} |