1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-11-06 09:09:19 +02:00

abapEnvironmentPipeline: testBuild Parameter (#4108)

* testBuild Parameter, first try

* add testBuild to general_config_keys

* hard coded stageName

* skip stage publish for testBuild

* add missing import
This commit is contained in:
tiloKo
2022-11-22 11:10:10 +01:00
committed by GitHub
parent 959fa964b1
commit f0cb8c6fc2
6 changed files with 106 additions and 39 deletions

View File

@@ -59,7 +59,6 @@ class AbapEnvironmentPipelineStageBuildTest extends BasePiperTest {
'abapAddonAssemblyKitCreateTargetVector',
'abapAddonAssemblyKitPublishTargetVector'))
assertThat(stepsCalled, not(hasItems('abapEnvironmentCreateTag')))
}
@Test
@@ -80,4 +79,22 @@ class AbapEnvironmentPipelineStageBuildTest extends BasePiperTest {
assertThat(stepsCalled, not(hasItems('cloudFoundryCreateServiceKey')))
}
@Test
void testAbapEnvironmentRunTest4TestBuild() {
nullScript.commonPipelineEnvironment.configuration.runStage = [
'Build': true
]
jsr.step.abapEnvironmentPipelineStageBuild(script: nullScript, testBuild: true, generateTagForAddonComponentVersion: true)
assertThat(stepsCalled, hasItems('cloudFoundryCreateServiceKey',
'abapEnvironmentAssemblePackages',
'abapEnvironmentBuild',
'abapAddonAssemblyKitRegisterPackages',
'abapAddonAssemblyKitCreateTargetVector'))
assertThat(stepsCalled, not(hasItems('abapAddonAssemblyKitReleasePackages',
'abapEnvironmentAssembleConfirm',
'abapAddonAssemblyKitPublishTargetVector',
'abapEnvironmentCreateTag')))
}
}

View File

@@ -97,4 +97,19 @@ class abapEnvironmentPipelineStageIntegrationTestsTest extends BasePiperTest {
assertThat(stepsCalled, hasItems('cloudFoundryDeleteService'))
}
@Test
void testIntegrationTestsTageSkipped4testBuild() {
nullScript.commonPipelineEnvironment.configuration.runStage = [
'Integration Tests': true
]
jsr.step.abapEnvironmentPipelineStageIntegrationTests(script: nullScript, testBuild: true)
assertThat(stepsCalled, not(hasItems('input',
'abapEnvironmentCreateSystem',
'cloudFoundryDeleteService',
'abapEnvironmentBuild',
'cloudFoundryCreateServiceKey')))
}
}

View File

@@ -48,4 +48,11 @@ class abapEnvironmentPipelineStagePublishTest extends BasePiperTest {
assertThat(stepsCalled, hasItem('abapAddonAssemblyKitPublishTargetVector'))
}
@Test
void testPublishSkipped4testBuild() {
nullScript.commonPipelineEnvironment.configuration.runStage = []
jsr.step.abapEnvironmentPipelineStagePublish(script: nullScript, testBuild: true)
assertThat(stepsCalled, not(hasItem('abapAddonAssemblyKitPublishTargetVector')))
}
}