mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
Don't print messages in all uppercase letters (#531)
This commit is contained in:
parent
02afb22c74
commit
ada3ed909d
@ -19,23 +19,23 @@ none
|
||||
* `stepParameters` - The parameters from the step to be executed. The list of parameters is then shown in the console output.
|
||||
* `stepName` - The name of the step executed to be shown in the console output.
|
||||
* `echoDetails` - If set to true the following will be output to the console:
|
||||
1. Step beginning: `--- BEGIN LIBRARY STEP: ${stepName}.groovy ---`
|
||||
2. Step end: `--- END LIBRARY STEP: ${stepName}.groovy ---`
|
||||
1. Step beginning: `--- Begin library step: ${stepName}.groovy ---`
|
||||
2. Step end: `--- End library step: ${stepName}.groovy ---`
|
||||
3. Step errors:
|
||||
|
||||
```log
|
||||
----------------------------------------------------------
|
||||
--- ERROR OCCURED IN LIBRARY STEP: ${stepName}
|
||||
--- An error occurred in the library step: ${stepName}
|
||||
----------------------------------------------------------
|
||||
FOLLOWING PARAMETERS WERE AVAILABLE TO THIS STEP:
|
||||
The following parameters were available to the step:
|
||||
***
|
||||
${stepParameters}
|
||||
***
|
||||
ERROR WAS:
|
||||
The error was:
|
||||
***
|
||||
${err}
|
||||
***
|
||||
FURTHER INFORMATION:
|
||||
Further information:
|
||||
* Documentation of step ${stepName}: .../${stepName}/
|
||||
* Pipeline documentation: https://...
|
||||
* GitHub repository for pipeline steps: https://...
|
||||
|
@ -1,18 +1,18 @@
|
||||
----------------------------------------------------------
|
||||
--- ERROR OCCURRED IN LIBRARY STEP: ${stepName}
|
||||
--- An error occurred in the library step: ${stepName}
|
||||
----------------------------------------------------------
|
||||
|
||||
FOLLOWING PARAMETERS WERE AVAILABLE TO THIS STEP:
|
||||
The following parameters were available to the step:
|
||||
***
|
||||
${stepParameters}
|
||||
***
|
||||
|
||||
ERROR WAS:
|
||||
The error was:
|
||||
***
|
||||
${error}
|
||||
***
|
||||
|
||||
FURTHER INFORMATION:
|
||||
Further information:
|
||||
* Documentation of library step ${stepName}: https://sap.github.io/jenkins-library/steps/${stepName}/
|
||||
* Source code of library step ${stepName}: https://github.com/SAP/jenkins-library/blob/master/vars/${stepName}.groovy
|
||||
* Library documentation: https://sap.github.io/jenkins-library/
|
||||
|
@ -37,8 +37,8 @@ class HandlePipelineStepErrorsTest extends BasePiperTest {
|
||||
}
|
||||
// asserts
|
||||
assertThat(isExecuted, is(true))
|
||||
assertThat(loggingRule.log, containsString('--- BEGIN LIBRARY STEP: testStep'))
|
||||
assertThat(loggingRule.log, containsString('--- END LIBRARY STEP: testStep'))
|
||||
assertThat(loggingRule.log, containsString('--- Begin library step of: testStep'))
|
||||
assertThat(loggingRule.log, containsString('--- End library step of: testStep'))
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -54,9 +54,9 @@ class HandlePipelineStepErrorsTest extends BasePiperTest {
|
||||
} catch (ignore) {
|
||||
} finally {
|
||||
// asserts
|
||||
assertThat(loggingRule.log, not(containsString('--- BEGIN LIBRARY STEP: testStep')))
|
||||
assertThat(loggingRule.log, not(containsString('--- END LIBRARY STEP: testStep')))
|
||||
assertThat(loggingRule.log, not(containsString('--- ERROR OCCURRED IN LIBRARY STEP: testStep')))
|
||||
assertThat(loggingRule.log, not(containsString('--- Begin library step of: testStep')))
|
||||
assertThat(loggingRule.log, not(containsString('--- End library step: testStep')))
|
||||
assertThat(loggingRule.log, not(containsString('--- An error occurred in the library step: testStep')))
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ class HandlePipelineStepErrorsTest extends BasePiperTest {
|
||||
} finally {
|
||||
// asserts
|
||||
assertThat(isReported, is(true))
|
||||
assertThat(loggingRule.log, containsString('--- ERROR OCCURRED IN LIBRARY STEP: testStep'))
|
||||
assertThat(loggingRule.log, containsString('--- An error occurred in the library step: testStep'))
|
||||
assertThat(loggingRule.log, containsString('[something:anything]'))
|
||||
}
|
||||
}
|
||||
|
@ -10,10 +10,10 @@ void call(Map parameters = [:], body) {
|
||||
def message = ''
|
||||
try {
|
||||
if (stepParameters == null && stepName == null)
|
||||
error "step handlePipelineStepErrors requires following mandatory parameters: stepParameters, stepName"
|
||||
error "The step handlePipelineStepErrors requires following mandatory parameters: stepParameters, stepName"
|
||||
|
||||
if (verbose)
|
||||
echo "--- BEGIN LIBRARY STEP: ${stepName} ---"
|
||||
echo "--- Begin library step of: ${stepName} ---"
|
||||
|
||||
body()
|
||||
} catch (Throwable err) {
|
||||
@ -28,7 +28,7 @@ void call(Map parameters = [:], body) {
|
||||
throw err
|
||||
} finally {
|
||||
if (verbose)
|
||||
message += "--- END LIBRARY STEP: ${stepName} ---"
|
||||
message += "--- End library step of: ${stepName} ---"
|
||||
echo message
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user