mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-03 15:02:35 +02:00
fix(spinnaker): fix MissingPropertyException (#1543)
* add test case * fix issue
This commit is contained in:
parent
f9be21900e
commit
0ce6473a98
@ -48,7 +48,6 @@ class SpinnakerTriggerPipelineTest extends BasePiperTest {
|
||||
Map credentialFileNames = [
|
||||
'spinnaker-client-certificate': 'clientCert.file',
|
||||
'spinnaker-client-key': 'clientKey.file'
|
||||
|
||||
]
|
||||
|
||||
helper.registerAllowedMethod('withCredentials', [List, Closure], { l, c ->
|
||||
@ -182,7 +181,8 @@ class SpinnakerTriggerPipelineTest extends BasePiperTest {
|
||||
nullScript.commonPipelineEnvironment.configuration = [
|
||||
general: [
|
||||
spinnakerGateUrl: 'https://spinnakerTest.url',
|
||||
spinnakerApplication: 'spinnakerTestApp'
|
||||
spinnakerApplication: 'spinnakerTestApp',
|
||||
verbose: true
|
||||
],
|
||||
stages: [
|
||||
testStage: [
|
||||
@ -193,10 +193,14 @@ class SpinnakerTriggerPipelineTest extends BasePiperTest {
|
||||
]
|
||||
|
||||
shellRule.setReturnValue('curl -X GET https://spinnakerTest.url/testRef --silent --cert $clientCertificate --key $clientKey', '{"status": "FAILED"}')
|
||||
shellRule.setReturnValue('curl -X GET https://spinnakerTest.url/testRef --verbose --cert $clientCertificate --key $clientKey', '{"status": "FAILED"}')
|
||||
|
||||
exception.expect(hudson.AbortException)
|
||||
exception.expectMessage('Spinnaker pipeline failed with FAILED')
|
||||
stepRule.step.spinnakerTriggerPipeline(
|
||||
script: nullScript,
|
||||
)
|
||||
try {
|
||||
stepRule.step.spinnakerTriggerPipeline(script: nullScript)
|
||||
} finally {
|
||||
assertThat(logginRule.log, containsString('Full Spinnaker response = '))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ void call(Map parameters = [:]) {
|
||||
}
|
||||
if (pipelineStatusResponseObj.status != 'SUCCEEDED') {
|
||||
if (config.verbose) {
|
||||
echo "[${STEP_NAME}] Full Spinnaker response = ${new JsonUtils().groovyObjectToPrettyJsonString(pipelineStatusResponse)}"
|
||||
echo "[${STEP_NAME}] Full Spinnaker response = ${new JsonUtils().groovyObjectToPrettyJsonString(pipelineStatusResponseObj)}"
|
||||
}
|
||||
error "[${STEP_NAME}] Spinnaker pipeline failed with ${pipelineStatusResponseObj.status}"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user