-
Notifications
You must be signed in to change notification settings - Fork 719
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dedicated job to debug TestMutationSecondMasterSetDown (#2849)
Run the E2E test `TestMutationSecondMasterSetDown` with `--skip-cleanup` enabled to prevent to run cleanup actions in the k8s cluster every 30 minutes. The post action to delete the k8s cluster at the end of the job is run only if there is no failed tests.
- Loading branch information
Showing
3 changed files
with
132 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
- job: | ||
description: Run a particular ECK E2E tests on GKE | ||
name: cloud-on-k8s-e2e-tests-testmutationsecondmastersetdown | ||
project-type: pipeline | ||
triggers: | ||
- timed: 'H/30 * * * *' | ||
concurrent: true | ||
pipeline-scm: | ||
scm: | ||
- git: | ||
url: https://github.com/elastic/cloud-on-k8s | ||
branches: | ||
- master | ||
credentials-id: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba' | ||
script-path: .ci/pipelines/e2e-tests-testmutationsecondmastersetdown.Jenkinsfile | ||
lightweight-checkout: true |
112 changes: 112 additions & 0 deletions
112
.ci/pipelines/e2e-tests-testmutationsecondmastersetdown.Jenkinsfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
// This library overrides the default checkout behavior to enable sleep+retries if there are errors | ||
// Added to help overcome some recurring github connection issues | ||
@Library('apm@current') _ | ||
|
||
def failedTests = [] | ||
def lib | ||
|
||
pipeline { | ||
|
||
agent { | ||
label 'linux' | ||
} | ||
|
||
options { | ||
timeout(time: 300, unit: 'MINUTES') | ||
} | ||
|
||
environment { | ||
VAULT_ADDR = credentials('vault-addr') | ||
VAULT_ROLE_ID = credentials('vault-role-id') | ||
VAULT_SECRET_ID = credentials('vault-secret-id') | ||
GCLOUD_PROJECT = credentials('k8s-operators-gcloud-project') | ||
} | ||
|
||
stages { | ||
stage('Checkout from GitHub') { | ||
steps { | ||
checkout scm | ||
} | ||
} | ||
stage('Load common scripts') { | ||
steps { | ||
script { | ||
lib = load ".ci/common/tests.groovy" | ||
} | ||
} | ||
} | ||
/* stage('Run Checks') { | ||
when { | ||
expression { | ||
notOnlyDocs() | ||
} | ||
} | ||
steps { | ||
sh 'make -C .ci TARGET=ci-check ci' | ||
} | ||
}*/ | ||
stage("E2E tests") { | ||
when { | ||
expression { | ||
notOnlyDocs() | ||
} | ||
} | ||
steps { | ||
sh '.ci/setenvconfig e2e/master' | ||
|
||
sh 'echo TESTS_MATCH = TestMutationSecondMasterSetDown >> .env' | ||
sh 'echo E2E_SKIP_CLEANUP = true >> .env' | ||
sh 'sed "s/CLUSTER_NAME=eck-e2e/CLUSTER_NAME=eck-debug-e2e/" -i .env' | ||
|
||
script { | ||
env.SHELL_EXIT_CODE = sh(returnStatus: true, script: 'make -C .ci get-test-artifacts TARGET=ci-build-operator-e2e-run ci') | ||
|
||
sh 'make -C .ci TARGET=e2e-generate-xml ci' | ||
junit "e2e-tests.xml" | ||
|
||
if (env.SHELL_EXIT_CODE != 0) { | ||
failedTests = lib.getListOfFailedTests() | ||
} | ||
|
||
sh 'exit $SHELL_EXIT_CODE' | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
unsuccessful { | ||
script { | ||
def msg = lib.generateSlackMessage("E2E tests failed!", env.BUILD_URL, failedTests) | ||
|
||
slackSend( | ||
channel: '#cloud-k8s', | ||
color: 'danger', | ||
message: msg, | ||
tokenCredentialId: 'cloud-ci-slack-integration-token', | ||
botUser: true, | ||
failOnError: true | ||
) | ||
} | ||
} | ||
cleanup { | ||
script { | ||
if (notOnlyDocs() && failedTests.size == 0) { | ||
build job: 'cloud-on-k8s-e2e-cleanup', | ||
parameters: [string(name: 'JKS_PARAM_GKE_CLUSTER', value: "eck-e2e-${BUILD_NUMBER}")], | ||
wait: false | ||
} | ||
} | ||
|
||
cleanWs() | ||
} | ||
} | ||
} | ||
|
||
def notOnlyDocs() { | ||
// grep succeeds if there is at least one line without docs/ | ||
return sh ( | ||
script: "git diff --name-status HEAD~1 HEAD | grep -v docs/", | ||
returnStatus: true | ||
) == 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters