mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-18 05:18:24 +02:00
Fix checkmarx execute scan (#2747)
* Fixes infinite recursion Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds test for infinite recursion Signed-off-by: Fabian Reh <fabian.reh@sap.com>
This commit is contained in:
parent
bb62252600
commit
9f55c4360d
@ -43,7 +43,7 @@ func (checkmarxExecuteScanUtilsBundle) PathMatch(pattern, name string) (bool, er
|
||||
}
|
||||
|
||||
func (b checkmarxExecuteScanUtilsBundle) GetWorkspace() string {
|
||||
return b.GetWorkspace()
|
||||
return b.workspace
|
||||
}
|
||||
|
||||
func (checkmarxExecuteScanUtilsBundle) WriteFile(filename string, data []byte, perm os.FileMode) error {
|
||||
|
@ -954,3 +954,13 @@ func TestLoadPreset(t *testing.T) {
|
||||
assert.Equal(t, 0, preset.ID, "Expected result but got none")
|
||||
})
|
||||
}
|
||||
|
||||
func TestPreventInfiniteLoop(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
utils := checkmarxExecuteScanUtilsBundle{
|
||||
workspace: "abc",
|
||||
}
|
||||
|
||||
assert.Equal(t, "abc", utils.GetWorkspace(), "Wrong workspace has been loaded")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user