From ac8946dd7149676e0ad0ddf61c02438dfe442e23 Mon Sep 17 00:00:00 2001 From: jperez Date: Tue, 2 Apr 2024 17:33:54 +0200 Subject: [PATCH] tests/csgrep: added tests for column property in Coverity JSONv10 Related https://issues.redhat.com/browse/OSH-11 Added tests for the column property in Coverity using JSON v10 results. Two different tests cases have been added: IN one of them, the column number is present in the results. In the second one, the column number is null --- .../0122-json-parser-cov-v10-column-args.txt | 1 + .../0122-json-parser-cov-v10-column-stdin.txt | 195 ++++++++++++++++++ ...0122-json-parser-cov-v10-column-stdout.txt | 70 +++++++ tests/csgrep/CMakeLists.txt | 1 + 4 files changed, 267 insertions(+) create mode 100644 tests/csgrep/0122-json-parser-cov-v10-column-args.txt create mode 100644 tests/csgrep/0122-json-parser-cov-v10-column-stdin.txt create mode 100644 tests/csgrep/0122-json-parser-cov-v10-column-stdout.txt diff --git a/tests/csgrep/0122-json-parser-cov-v10-column-args.txt b/tests/csgrep/0122-json-parser-cov-v10-column-args.txt new file mode 100644 index 00000000..7df3c951 --- /dev/null +++ b/tests/csgrep/0122-json-parser-cov-v10-column-args.txt @@ -0,0 +1 @@ +--mode=json diff --git a/tests/csgrep/0122-json-parser-cov-v10-column-stdin.txt b/tests/csgrep/0122-json-parser-cov-v10-column-stdin.txt new file mode 100644 index 00000000..d11cb2c0 --- /dev/null +++ b/tests/csgrep/0122-json-parser-cov-v10-column-stdin.txt @@ -0,0 +1,195 @@ +{ + "type" : "Coverity issues", + "formatVersion" : 10, + "suppressedIssueCount" : 0, + "issues" : [ + { + "mergeKey" : "0d67db2be2df7aa477796bac827f024b", + "occurrenceCountForMK" : 1, + "occurrenceNumberInMK" : 1, + "referenceOccurrenceCountForMK" : null, + "checkerName" : "HARDCODED_CREDENTIALS", + "subcategory" : "none", + "type" : "hardcoded_credentials", + "code-language" : "python", + "extra" : "\"app\",\"secret_key\"", + "domain" : "OTHER", + "language" : "Python 3", + "mainEventFilePathname" : "/tmp/cspodmanu0m_p6ko/istio-proxyv2/unpacked_remote_sources/istio/app/samples/bookinfo/src/productpage/productpage.py", + "strippedMainEventFilePathname" : "/tmp/cspodmanu0m_p6ko/istio-proxyv2/unpacked_remote_sources/istio/app/samples/bookinfo/src/productpage/productpage.py", + "mainEventLineNumber" : 56, + "mainEventColumnNumber" : 1, + "properties" : {}, + "functionDisplayName" : "