Skip to content

Commit

Permalink
Add test for "no-new-issues"
Browse files Browse the repository at this point in the history
A test cases similar to "no-files-to-check", except there are files to
check but they don't introduce any new issues.

Signed-off-by: Adam Cmiel <[email protected]>
  • Loading branch information
chmeliik committed Jul 22, 2024
1 parent 115b496 commit fca8c5c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/differential.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,8 @@ test_differential_checkton() {
@test "generating an empty SARIF when there are no files to check" {
test_differential_checkton no-files-to-check
}

@test "generating an empty SARIF when there files to check but no new issues" {
test_differential_checkton no-new-issues \
"$R/patches/0001-Rename-tektontask-to-cooltask.patch"
}
25 changes: 25 additions & 0 deletions test/resources/differential/no-new-issues/csdiff.sarif
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://json.schemastore.org/sarif-2.1.0.json",
"version": "2.1.0",
"inlineExternalProperties": [
{
"externalizedProperties": {
"tool": "ShellCheck",
"tool-url": "https://www.shellcheck.net/wiki/",
"tool-version": "0.9.0"
}
}
],
"runs": [
{
"tool": {
"driver": {
"name": "ShellCheck",
"version": "0.9.0",
"informationUri": "https://www.shellcheck.net/wiki/"
}
},
"results": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions test/resources/differential/no-new-issues/sarif-fmt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit fca8c5c

Please sign in to comment.