-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GitHubDspIngestionVisitor (#2061)
Add file-based unit tests for the `GitHubDspIngestionVisitor` and fix the bugs that they reveal: - #2058: GitHubDspIngestionVisitor limits number of results only if some of them are non-errors - #2060: GitHubDspIngestionVisitor removes codeFlows entirely rather than inlining threadFlowLocations When inlining `threadFlowLocations`, we have to take care to distinguish those properties that are shared among all usages of a given location (for example, the `location` and `module` properties) from those properties that vary across usages (for example, `executionTimeUtc` and `state`). The `location.message` requires special handling because we do want to take `location` from the shared object, but we don't necessarily want to take `location.message`. Finally, we merge the property bags, preferring the values in the per-usage property bag if there are any overlaps. We also have to merge property bags when inlining artifact locations.
- Loading branch information
Larry Golding
committed
Sep 4, 2020
1 parent
ffe27f2
commit e96e36c
Showing
19 changed files
with
926 additions
and
34 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
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
26 changes: 26 additions & 0 deletions
26
...est.UnitTests.Sarif/TestData/GitHubDspIngestionVisitor/ExpectedOutputs/Fingerprints.sarif
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,26 @@ | ||
{ | ||
"$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", | ||
"version": "2.1.0", | ||
"runs": [ | ||
{ | ||
"tool": { | ||
"driver": { | ||
"name": "Sarif.UnitTests" | ||
} | ||
}, | ||
"results": [ | ||
{ | ||
"ruleId": "TEST1001", | ||
"level": "error", | ||
"message": { | ||
"text": "The message." | ||
}, | ||
"partialFingerprints": { | ||
"f1": "f1-value", | ||
"f2": "f2-value" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
29 changes: 29 additions & 0 deletions
29
....UnitTests.Sarif/TestData/GitHubDspIngestionVisitor/ExpectedOutputs/NonErrorResults.sarif
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,29 @@ | ||
{ | ||
"$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", | ||
"version": "2.1.0", | ||
"runs": [ | ||
{ | ||
"tool": { | ||
"driver": { | ||
"name": "Sarif.UnitTests" | ||
} | ||
}, | ||
"results": [ | ||
{ | ||
"ruleId": "TEST1002", | ||
"level": "error", | ||
"message": { | ||
"text": "The message." | ||
} | ||
}, | ||
{ | ||
"ruleId": "TEST1003", | ||
"level": "error", | ||
"message": { | ||
"text": "The message." | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.