Merge pull request #500 from weloli/pr/fixStageDoc

Fix generation of stage scope documentation
This commit is contained in:
Marcus Holl
2019-03-15 15:30:48 +01:00
committed by GitHub
2 changed files with 22 additions and 6 deletions
+4 -5
View File
@@ -45,12 +45,12 @@ class TemplateHelper {
|
|In following sections of the config.yml the configuration is possible:\n\n'''.stripMargin()
t += '| parameter | general | step | stage |\n'
t += '|-----------|---------|------|-------|\n'
t += '| parameter | general | step/stage |\n'
t += '|-----------|---------|------------|\n'
parameters.keySet().toSorted().each {
def props = parameters.get(it)
t += "| `${it}` | ${props.GENERAL_CONFIG ? 'X' : ''} | ${props.STEP_CONFIG ? 'X' : ''} | ${props.STAGE_CONFIG ? 'X' : ''} |\n"
t += "| `${it}` | ${props.GENERAL_CONFIG ? 'X' : ''} | ${props.STEP_CONFIG ? 'X' : ''} |\n"
}
t.trim()
@@ -517,8 +517,7 @@ def handleStep(stepName, prepareDefaultValuesStep, gse) {
required: true,
GENERAL_CONFIG: false,
STEP_CONFIG: false,
STAGE_CONFIG: false
STEP_CONFIG: false
]
// END special handling for 'script' parameter
@@ -4,7 +4,7 @@ import org.junit.Test
import org.junit.rules.ExpectedException
import org.junit.rules.RuleChain
import com.sap.piper.GitUtils
import com.sap.piper.cm.BackendType
import com.sap.piper.cm.ChangeManagement
import com.sap.piper.cm.ChangeManagementException
@@ -155,6 +155,23 @@ class CheckChangeInDevelopmentTest extends BasePiperTest {
}
@Test
public void stageConfigIsNotConsideredWithParamKeysTest() {
nullScript.commonPipelineEnvironment.configuration = [stages:[foo:[changeDocumentId:'12345']]]
ChangeManagement cm = getChangeManagementUtils(true, '')
thrown.expect(IllegalArgumentException)
thrown.expectMessage('No changeDocumentId provided.')
stepRule.step.checkChangeInDevelopment(
script: nullScript,
cmUtils: cm,
changeManagement: [type: BackendType.SOLMAN,
endpoint: 'https://example.org/cm'],
stageName: 'foo')
}
private ChangeManagement getChangeManagementUtils(boolean inDevelopment, String changeDocumentId = '001') {
return new ChangeManagement(nullScript, null) {