mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-20 05:19:40 +02:00
Add deployment to performance tests stage and enable stage (#2370)
Co-authored-by: Kevin Hudemann <kevin.hudemann@sap.com>
This commit is contained in:
parent
3e3a29ffd2
commit
647e1ef0bd
@ -70,7 +70,16 @@ stages:
|
||||
- 'userTokenCredentialsId'
|
||||
- 'whitesource/userTokenCredentialsId'
|
||||
- 'whitesourceUserTokenCredentialsId'
|
||||
Performance: {}
|
||||
Performance:
|
||||
stepConditions:
|
||||
multicloudDeploy:
|
||||
configKeys:
|
||||
- 'cfTargets'
|
||||
- 'neoTargets'
|
||||
gatlingExecuteTests:
|
||||
filePatternFromConfig: 'pomPath'
|
||||
configKeys:
|
||||
- 'appUrls'
|
||||
Compliance: {}
|
||||
Promote:
|
||||
stepConditions:
|
||||
|
@ -27,6 +27,12 @@ Acceptance:
|
||||
- deployDescriptor
|
||||
stashes: []
|
||||
|
||||
Performance:
|
||||
unstash:
|
||||
- source
|
||||
- buildResult
|
||||
stashes: []
|
||||
|
||||
Release:
|
||||
unstash:
|
||||
- buildResult
|
||||
|
@ -37,6 +37,10 @@ class PiperPipelineStagePerformanceTest extends BasePiperTest {
|
||||
stepsCalled.add('gatlingExecuteTests')
|
||||
stepParameters.gatlingExecuteTests = m
|
||||
})
|
||||
helper.registerAllowedMethod('multicloudDeploy', [Map.class], {m ->
|
||||
stepsCalled.add('multicloudDeploy')
|
||||
stepParameters.multicloudDeploy = m
|
||||
})
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -45,7 +49,7 @@ class PiperPipelineStagePerformanceTest extends BasePiperTest {
|
||||
script: nullScript,
|
||||
juStabUtils: utils,
|
||||
)
|
||||
assertThat(stepsCalled, not(anyOf(hasItems('gatlingExecuteTests'))))
|
||||
assertThat(stepsCalled, not(anyOf(hasItems('gatlingExecuteTests', 'multicloudDeploy'))))
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -58,4 +62,15 @@ class PiperPipelineStagePerformanceTest extends BasePiperTest {
|
||||
assertThat(stepsCalled, hasItems('gatlingExecuteTests'))
|
||||
assertNotNull(stepParameters.gatlingExecuteTests)
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMulticloudDeployTests() {
|
||||
jsr.step.piperPipelineStagePerformance(
|
||||
script: nullScript,
|
||||
juStabUtils: utils,
|
||||
multicloudDeploy: true
|
||||
)
|
||||
assertThat(stepsCalled, hasItems('multicloudDeploy'))
|
||||
assertNotNull(stepParameters.multicloudDeploy)
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ import static com.sap.piper.Prerequisites.checkScript
|
||||
@Field STAGE_STEP_KEYS = [
|
||||
/** Executes Gatling performance tests */
|
||||
'gatlingExecuteTests',
|
||||
/** Can perform both to cloud foundry and neo targets. Preferred over cloudFoundryDeploy and neoDeploy, if configured. */
|
||||
'multicloudDeploy',
|
||||
]
|
||||
@Field Set STEP_CONFIG_KEYS = GENERAL_CONFIG_KEYS.plus(STAGE_STEP_KEYS)
|
||||
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS
|
||||
@ -34,6 +36,7 @@ void call(Map parameters = [:]) {
|
||||
.mixinGeneralConfig(script.commonPipelineEnvironment, GENERAL_CONFIG_KEYS)
|
||||
.mixinStageConfig(script.commonPipelineEnvironment, stageName, STEP_CONFIG_KEYS)
|
||||
.mixin(parameters, PARAMETER_KEYS)
|
||||
.addIfEmpty('multicloudDeploy', script.commonPipelineEnvironment.configuration.runStep?.get(stageName)?.multicloudDeploy)
|
||||
.addIfEmpty('gatlingExecuteTests', script.commonPipelineEnvironment.configuration.runStep?.get(stageName)?.gatlingExecuteTests)
|
||||
.use()
|
||||
|
||||
@ -42,6 +45,12 @@ void call(Map parameters = [:]) {
|
||||
// telemetry reporting
|
||||
utils.pushToSWA([step: STEP_NAME], config)
|
||||
|
||||
if (config.multicloudDeploy) {
|
||||
durationMeasure(script: script, measurementName: 'deploy_performance_multicloud_duration') {
|
||||
multicloudDeploy(script: script, stage: stageName)
|
||||
}
|
||||
}
|
||||
|
||||
if (config.gatlingExecuteTests) {
|
||||
durationMeasure(script: script, measurementName: 'gatling_duration') {
|
||||
gatlingExecuteTests script: script
|
||||
|
Loading…
x
Reference in New Issue
Block a user