1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

checkmarxExecuteScan: Improve error message on compliance issues (#3083)

* Update checkmarxExecuteScan.go

* Fix test
This commit is contained in:
Sven Merk 2021-09-07 13:10:11 +02:00 committed by GitHub
parent 97a173952b
commit 2997714a02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -106,7 +106,7 @@ func runScan(config checkmarxExecuteScanOptions, sys checkmarx.System, influx *c
err = uploadAndScan(config, sys, project, influx, utils)
if err != nil {
return errors.Wrap(err, "failed to run scan and upload result")
return errors.Wrap(err, "scan, upload, and result validation returned an error")
}
return nil
}

View File

@ -662,7 +662,7 @@ func TestVerifyOnly_errorOnWriteFileDoesNotBlock(t *testing.T) {
utilsMock.errorOnWriteFile = true
err = runScan(options, sys, &influx, utilsMock)
assert.EqualError(t, err, "failed to run scan and upload result: project TestExisting not compliant: failed to get detailed results: failed to write file: error on WriteFile")
assert.EqualError(t, err, "scan, upload, and result validation returned an error: project TestExisting not compliant: failed to get detailed results: failed to write file: error on WriteFile")
}
func TestRunScanWOtherCycle(t *testing.T) {
@ -711,7 +711,7 @@ func TestRunScanErrorInZip(t *testing.T) {
utilsMock.errorOnFileInfoHeader = true
err = runScan(options, sys, &influx, utilsMock)
assert.EqualError(t, err, "failed to run scan and upload result: failed to zip workspace files: failed to compact folder: error on FileInfoHeader")
assert.EqualError(t, err, "scan, upload, and result validation returned an error: failed to zip workspace files: failed to compact folder: error on FileInfoHeader")
}
func TestRunScanForPullRequest(t *testing.T) {