You've already forked sap-jenkins-library
							
							
				mirror of
				https://github.com/SAP/jenkins-library.git
				synced 2025-10-30 23:57:50 +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:
		| @@ -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") | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user