You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-11-06 09:09:19 +02:00
[E2E Tests step] Allow Conditional check with on_k8s env variable (#3985)
* Conditional check with on_k8s env variable * Add ON_K8S unit test Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
This commit is contained in:
committed by
GitHub
parent
e610bda779
commit
ac9bd28c42
@@ -239,7 +239,7 @@ class NpmExecuteEndToEndTestsTest extends BasePiperTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void parallelE2eTestOnKubernetes() {
|
||||
void parallelE2eTestOnKubernetes_setWith_POD_NAME_EnvVariable() {
|
||||
def appUrl = [url: "http://my-url.com", credentialId: 'testCred']
|
||||
binding.variables.env.POD_NAME = "name"
|
||||
|
||||
@@ -259,4 +259,27 @@ class NpmExecuteEndToEndTestsTest extends BasePiperTest {
|
||||
assertFalse(executedOnNode)
|
||||
assertTrue(executedOnKubernetes)
|
||||
}
|
||||
|
||||
@Test
|
||||
void parallelE2eTestOnKubernetes_setWith_ON_K8S_EnvVariable() {
|
||||
def appUrl = [url: "http://my-url.com", credentialId: 'testCred']
|
||||
binding.variables.env.ON_K8S = "true"
|
||||
|
||||
nullScript.commonPipelineEnvironment.configuration = [
|
||||
general: [parallelExecution: true],
|
||||
stages: [
|
||||
myStage:[
|
||||
appUrls: [appUrl]
|
||||
]]]
|
||||
|
||||
stepRule.step.npmExecuteEndToEndTests(
|
||||
script: nullScript,
|
||||
stageName: "myStage",
|
||||
runScript: "ci-e2e"
|
||||
)
|
||||
|
||||
assertTrue(executedInParallel)
|
||||
assertFalse(executedOnNode)
|
||||
assertTrue(executedOnKubernetes)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user