Skip to content

Commit

Permalink
Fix paths in test snapshots (google#930)
Browse files Browse the repository at this point in the history
Remove local paths from snapshots
  • Loading branch information
another-rex authored Apr 17, 2024
1 parent a40c813 commit 37121e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/output/__snapshots__/sarif_internal_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ reason = "Your reason for ignoring this vulnerability"

| Source | Package Name | Package Version |
| --- | --- | --- |
| lockfile:/usr/local/google/home/rexpan/Documents/Project/engine/deps_flatten.txt | https://fuchsia.googlesource.com/third_party/android.googlesource.com/platform/external/perfetto | b8da07095979310818f0efde2ef3c69ea70d62c5 |
| lockfile:<rootdir>/Documents/Project/engine/deps_flatten.txt | https://fuchsia.googlesource.com/third_party/android.googlesource.com/platform/external/perfetto | b8da07095979310818f0efde2ef3c69ea70d62c5 |

## Remediation

Expand All @@ -179,7 +179,7 @@ See the format and more options in our documentation here: https://google.github

Add or append these values to the following config files to ignore this vulnerability:

`/usr/local/google/home/rexpan/Documents/Project/engine/osv-scanner.toml`
`<rootdir>/Documents/Project/engine/osv-scanner.toml`

```
[[IgnoredVulns]]
Expand Down
4 changes: 2 additions & 2 deletions internal/output/fixtures/commit-grouped.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"commit": "b8da07095979310818f0efde2ef3c69ea70d62c5"
},
"Source": {
"path": "/usr/local/google/home/rexpan/Documents/Project/engine/deps_flatten.txt",
"path": "<rootdir>/Documents/Project/engine/deps_flatten.txt",
"type": "lockfile"
}
}
Expand Down Expand Up @@ -126,4 +126,4 @@
"AliasedIDList": [
"OSV-2023-72"
]
}
}
2 changes: 1 addition & 1 deletion internal/output/sarif_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Test_createSARIFHelpText(t *testing.T) {
{
args: testutility.LoadJSONFixture[groupedSARIFFinding](t, "fixtures/commit-grouped.json"),
want: testutility.NewSnapshot().WithWindowsReplacements(map[string]string{
"\\usr\\local\\google\\home\\rexpan\\Documents\\Project\\engine/osv-scanner.toml": "/usr/local/google/home/rexpan/Documents/Project/engine/osv-scanner.toml",
"<rootdir>\\Documents\\Project\\engine/osv-scanner.toml": "<rootdir>/Documents/Project/engine/osv-scanner.toml",
}),
},
}
Expand Down
10 changes: 5 additions & 5 deletions internal/sourceanalysis/fixtures-go/govulncheckinput.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"package": "github.com/gogo/protobuf/proto",
"function": "RegisterEnum",
"position": {
"filename": "/usr/local/google/home/rexpan/go/pkg/mod/github.com/gogo/protobuf@v1.3.1/proto/properties.go",
"filename": "<rootdir>/go/pkg/mod/github.com/gogo/protobuf@v1.3.1/proto/properties.go",
"offset": 14200,
"line": 518,
"column": 6
Expand All @@ -21,7 +21,7 @@
"package": "github.com/gogo/protobuf/protoc-gen-gogo/descriptor",
"function": "init#1",
"position": {
"filename": "/usr/local/google/home/rexpan/go/pkg/mod/github.com/gogo/protobuf@v1.3.1/protoc-gen-gogo/descriptor/descriptor.pb.go",
"filename": "<rootdir>/go/pkg/mod/github.com/gogo/protobuf@v1.3.1/protoc-gen-gogo/descriptor/descriptor.pb.go",
"offset": 98891,
"line": 2668,
"column": 20
Expand All @@ -33,7 +33,7 @@
"package": "github.com/gogo/protobuf/protoc-gen-gogo/descriptor",
"function": "init",
"position": {
"filename": "/usr/local/google/home/rexpan/go/pkg/mod/github.com/gogo/protobuf@v1.3.1/protoc-gen-gogo/descriptor/descriptor.go",
"filename": "<rootdir>/go/pkg/mod/github.com/gogo/protobuf@v1.3.1/protoc-gen-gogo/descriptor/descriptor.go",
"offset": 1932,
"line": 37,
"column": 1
Expand All @@ -45,7 +45,7 @@
"package": "github.com/gogo/protobuf/plugin/unmarshal",
"function": "init",
"position": {
"filename": "/usr/local/google/home/rexpan/go/pkg/mod/github.com/gogo/protobuf@v1.3.1/plugin/unmarshal/unmarshal.go",
"filename": "<rootdir>/go/pkg/mod/github.com/gogo/protobuf@v1.3.1/plugin/unmarshal/unmarshal.go",
"offset": 5007,
"line": 184,
"column": 2
Expand All @@ -56,7 +56,7 @@
"package": "github.com/ossf-tests/osv-e2e",
"function": "init",
"position": {
"filename": "/usr/local/google/home/rexpan/Documents/Project/osv-scanner/internal/sourceanalysis/integration/fixtures-go/test-project/main.go",
"filename": "<rootdir>/Documents/Project/osv-scanner/internal/sourceanalysis/integration/fixtures-go/test-project/main.go",
"offset": 44,
"line": 7,
"column": 2
Expand Down

0 comments on commit 37121e3

Please sign in to comment.