1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/vars/abapEnvironmentPipelineStageAUnit.groovy

42 lines
1.7 KiB
Groovy
Raw Normal View History

A unit step integration (#3120) * Add AUnit stage * Add AUnit stage to ABAP Pipeline * Add Groovy Tests * surround header with space line * correct class name * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * Update tests & docu * adapt tests * Fix Pipeline Tests * adapt tests * Adapt tests * Adapt tests * docu fixes * Adapt tests * Improve Tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt host config * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * adapt docu links * adapt docu links * adapt docu links * adapt docu links * Add example to config docu * change docu * Change host check * Adapt tests * Add Prepare System defaults * Change Prepare System defaults * return after writing xml results * change logging * return after results have been persisted * Change host check * echo test * echo test * echo test * echo test * echo test * config host checker working * Enable host groovy test * remove duplicates * docu extension AUnit extension stage * Remove trailing spaces * package restrictions added to docu * correct to type * correct type aunit tests * add capital letters to docu examples * remove escape * adapt unit tests Co-authored-by: Daniel Mieg <daniel.mieg@sap.com> Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-11 16:10:14 +02:00
import groovy.transform.Field
import com.sap.piper.Utils
import com.sap.piper.ConfigurationHelper
import com.sap.piper.ConfigurationLoader
import static com.sap.piper.Prerequisites.checkScript
@Field String STEP_NAME = getClass().getName()
@Field Set GENERAL_CONFIG_KEYS = []
@Field STAGE_STEP_KEYS = [
/** Starts an AUnit test run on the ABAP Environment instance */
'abapEnvironmentRunAUnitTest',
/** Creates Communication Arrangements for ABAP Environment instance via the cloud foundry command line interface */
'cloudFoundryCreateServiceKey',
/** Parameter for host config */
'host'
]
@Field Set STEP_CONFIG_KEYS = GENERAL_CONFIG_KEYS.plus(STAGE_STEP_KEYS)
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS
void call(Map parameters = [:]) {
def script = checkScript(this, parameters) ?: this
def stageName = parameters.stageName?:env.STAGE_NAME
// load default & individual configuration
Map config = ConfigurationHelper.newInstance(this)
.loadStepDefaults([:], stageName)
.mixin(ConfigurationLoader.defaultStageConfiguration(script, stageName))
.mixinGeneralConfig(script.commonPipelineEnvironment, GENERAL_CONFIG_KEYS)
.mixinStepConfig(script.commonPipelineEnvironment, STEP_CONFIG_KEYS)
.mixinStageConfig(script.commonPipelineEnvironment, stageName, STEP_CONFIG_KEYS)
.mixin(parameters, PARAMETER_KEYS)
.use()
piperStageWrapper (script: script, stageName: stageName, stashContent: [], stageLocking: false) {
if (!config.host) {
cloudFoundryCreateServiceKey script: parameters.script
}
abapEnvironmentRunAUnitTest script: parameters.script
}
}