Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Sep 30, 2024
1 parent 8b3c1ab commit 6c0b4b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 14 additions & 0 deletions tests/utils/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,15 @@ func convertSarifRunPathsForOS(runs ...*sarif.Run) {
*location.PhysicalLocation.ArtifactLocation.URI = getJasConvertedPath(sarifutils.GetLocationFileName(location))
}
}
for _, codeFlow := range result.CodeFlows {
for _, threadFlows := range codeFlow.ThreadFlows {
for _, location := range threadFlows.Locations {
if location != nil && location.Location != nil && location.Location.PhysicalLocation != nil && location.Location.PhysicalLocation.ArtifactLocation != nil && location.Location.PhysicalLocation.ArtifactLocation.URI != nil {
*location.Location.PhysicalLocation.ArtifactLocation.URI = getJasConvertedPath(sarifutils.GetLocationFileName(location.Location))
}
}
}
}
}
}
}
Expand Down Expand Up @@ -217,6 +226,11 @@ func convertJasSimpleJsonPathsForOS(jas *formats.SourceCodeRow) {
return
}
jas.Location.File = getJasConvertedPath(jas.Location.File)
if jas.Applicability != nil {
for _, evidence := range jas.Applicability.Evidence {
evidence.Location.File = getJasConvertedPath(evidence.Location.File)
}
}
for _, codeFlow := range jas.CodeFlow {
for _, location := range codeFlow {
location.File = getJasConvertedPath(location.File)
Expand Down
4 changes: 0 additions & 4 deletions utils/results/output/securityJobSummary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ func TestSaveSarifOutputOnlyForJasEntitled(t *testing.T) {
name string
isJasEntitled bool
}{
{
name: "JAS entitled",
isJasEntitled: true,
},
{
name: "JAS not entitled",
isJasEntitled: false,
Expand Down

0 comments on commit 6c0b4b6

Please sign in to comment.