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

helmExecute triggered by buildExecute (#4521)

This commit is contained in:
Marcus Holl
2023-08-21 11:10:00 +02:00
committed by GitHub
parent 47f4b1e42d
commit d6d3b6b091
4 changed files with 46 additions and 2 deletions

View File

@@ -314,4 +314,41 @@ class BuildExecuteTest extends BasePiperTest {
)
assertThat(buildToolCalled, is(true))
}
@Test
void testHelmExecuteCalledWhenConfigured() {
def helmExecuteCalled = false
helper.registerAllowedMethod('helmExecute', [Map.class], { m ->
helmExecuteCalled = true
return
})
helper.registerAllowedMethod('npmExecuteScripts', [Map.class], { m ->
})
stepRule.step.buildExecute(
script: nullScript,
buildTool: 'npm',
helmExecute: true
)
assertThat(helmExecuteCalled, is(true))
}
@Test
void testHelmExecuteNotCalledWhenNotConfigured() {
def helmExecuteCalled = false
helper.registerAllowedMethod('helmExecute', [Map.class], { m ->
helmExecuteCalled = true
return
})
helper.registerAllowedMethod('npmExecuteScripts', [Map.class], { m ->
})
stepRule.step.buildExecute(
script: nullScript,
buildTool: 'npm',
helmExecute: false
)
assertThat(helmExecuteCalled, is(false))
}
}