From 1dda04107cb57c0df9a59c30664a5bdf4aa21d0c Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Mon, 17 May 2021 11:23:13 +0300 Subject: [PATCH] Switch E2E testing pipelines to new CRW Jenkins CI (#19443) Signed-off-by: Dmytro Nochevnov --- .github/CODEOWNERS | 1 - .../dashboard-next/pr-check/Jenkinsfile | 374 --------------- tests/.infra/crw-ci/master/k8s/Jenkinsfile | 159 ------- .../crw-ci/nightly/k8s/multi-host/Jenkinsfile | 190 -------- .../nightly/k8s/single-host/Jenkinsfile | 186 -------- tests/.infra/crw-ci/pr-check/k8s/Jenkinsfile | 433 ------------------ .../crw-ci/release-testing/k8s/Jenkinsfile | 194 -------- 7 files changed, 1537 deletions(-) delete mode 100644 tests/.infra/crw-ci/dashboard-next/pr-check/Jenkinsfile delete mode 100644 tests/.infra/crw-ci/master/k8s/Jenkinsfile delete mode 100644 tests/.infra/crw-ci/nightly/k8s/multi-host/Jenkinsfile delete mode 100644 tests/.infra/crw-ci/nightly/k8s/single-host/Jenkinsfile delete mode 100644 tests/.infra/crw-ci/pr-check/k8s/Jenkinsfile delete mode 100644 tests/.infra/crw-ci/release-testing/k8s/Jenkinsfile diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4612614995..8adcb39745 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -39,4 +39,3 @@ tests/e2e/** @musienko-maxim @Ohrimenko1988 @rhopp @nickboldt @Katka92 @ScrewTS # e2e tests infra tests/.infra/centos-ci/** @musienko-maxim @rhopp @nickboldt -tests/.infra/crw-ci/** @dmytro-ndp @rhopp @nickboldt diff --git a/tests/.infra/crw-ci/dashboard-next/pr-check/Jenkinsfile b/tests/.infra/crw-ci/dashboard-next/pr-check/Jenkinsfile deleted file mode 100644 index 453238c706..0000000000 --- a/tests/.infra/crw-ci/dashboard-next/pr-check/Jenkinsfile +++ /dev/null @@ -1,374 +0,0 @@ -#!groovy - -pipeline { - agent { label "minikube-rhel7-8gb" } - - options { - timestamps() - timeout(time: 90, unit: 'MINUTES') - buildDiscarder(logRotator(artifactDaysToKeepStr: '', - artifactNumToKeepStr: '', daysToKeepStr: '60', numToKeepStr: '100')) - } - - environment { - PATH = "/tmp:/qa/tools/opt/apache-maven-3.6.1/bin:/qa/tools/opt/openjdk-11.0.6.10/bin:$PATH" - JAVA_HOME="/qa/tools/opt/openjdk-11.0.6.10" - JENKINS_BUILD = "true" - - DEVFILE_PATH = "${WORKSPACE}/test-workspace-devfile.yaml" - CUSTOM_RESOURCE_PATCH_FILE = "${WORKSPACE}/custom-resource-patch.yaml" - - SUCCESS_THRESHOLD = 5 - - LOGS_AND_CONFIGS ="${WORKSPACE}/logs-and-configs" - - mutableDashboardImageTag = "" - pathToChectl = "" - - UPSTREAM_DASHBOARD_REPO_URL="https://github.com/eclipse-che/che-dashboard.git" - } - - parameters { - booleanParam(name: 'cheSingleHost', - defaultValue: false, - description: 'Configuration Che Server Exposure strategy') - - string(name: 'cheImageRepo', - defaultValue: "quay.io/eclipse/che-server", - description: 'Repo of Che server image') - - string(name: 'cheImageTag', - defaultValue: "nightly", - description: 'Tag of Che server image') - - string(name: 'dashboardImageRepo', - defaultValue: "quay.io/crw_pr/che-dashboard", - description: 'Repo of Che dashboard image') - - string(name: 'testWorkspaceDevfileUrl', - defaultValue: "", - description: 'URL of devfile of test workspace') - - string(name: 'ghprbSourceBranch', - defaultValue: "main") - - string(name: 'ghprbAuthorRepoGitUrl', - defaultValue: "https://github.com/eclipse-che/che-dashboard.git") - - string(name: 'e2eTestParameters', - defaultValue: "") - - string( - name: "chectlPackageUrl", - defaultValue: "", - description: "URL address of chectl package" - ) - - string( - name: "cheE2eImageTag", - defaultValue: "nightly", - description: "Tag of quay.io/eclipse/che-e2e image" - ) - } - - stages { - stage("Setup environment") { - steps { - script { - mutableDashboardImageTag = ghprbPullId - } - } - } - - stage("Prepare to start Che on K8S") { - failFast true - - parallel { - stage("Download chectl") { - steps { - script { - retry(2) { - if (chectlPackageUrl != "") { - sh """ - wget ${chectlPackageUrl} -O chectl-linux-x64.tar.gz - tar -xzf chectl-linux-x64.tar.gz - """ - pathToChectl = "${WORKSPACE}/chectl/bin/chectl" - - } else { - echo "Install chectl using https://www.eclipse.org/che/chectl/ --channel=next" - sh """ - curl -sL https://www.eclipse.org/che/chectl/ > install_chectl.sh - chmod +x install_chectl.sh - sudo PATH=$PATH ./install_chectl.sh --channel=next - sudo mv /usr/local/bin/chectl ${WORKSPACE}/chectl - sudo chmod +x ${WORKSPACE}/chectl - """ - pathToChectl = "${WORKSPACE}/chectl" - } - } - } - } - } - - stage("Start Kubernetes") { - steps { - script { - retry(2) { - echo "Workaround k8s error https://github.com/eclipse/che/issues/14902" - sh """ - cat /etc/sysctl.conf - echo "net.bridge.bridge-nf-call-iptables = 1" | sudo tee -a /etc/sysctl.conf - sudo sysctl -p - """ - - sh """ - # https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md - export MINIKUBE_WANTUPDATENOTIFICATION=false - export MINIKUBE_WANTREPORTERRORPROMPT=false - export MINIKUBE_HOME=\$HOME - export CHANGE_MINIKUBE_NONE_USER=true - export KUBECONFIG=\$HOME/.kube/config - export DOCKER_CONFIG=\$HOME/.docker - - mkdir -p \$HOME/.kube \$HOME/.minikube - touch \$KUBECONFIG - - sudo -E /usr/local/bin/minikube start \\ - --vm-driver=none \\ - --cpus 2 \\ - --memory 6500 \\ - --logtostderr - """ - } - } - } - } - - stage("Pull test images") { - steps { - script { - retry(2) { - echo "Pull test images" - sh """ - docker pull quay.io/eclipse/che-e2e:$cheE2eImageTag - """ - } - } - } - } - } - } - - stage("Build and push 'che-dashboard' image"){ - steps { - sh """ - echo "Download the 'che-dashboard' project and checkout to branch" - - git clone $ghprbAuthorRepoGitUrl - cd che-dashboard - - if [[ "$UPSTREAM_DASHBOARD_REPO_URL" != "$ghprbAuthorRepoGitUrl" ]]; then - echo "Using fork $ghprbAuthorRepoGitUrl" - git fetch -f $UPSTREAM_DASHBOARD_REPO_URL main:$ghprbSourceBranch - fi - - git checkout $ghprbSourceBranch - """ - - withCredentials([string(credentialsId: 'ed71c034-60bc-4fb1-bfdf-9570209076b5', variable: 'maxura_docker_password')]) { - sh """ - echo "Build 'che-dashboard' image" - echo "${maxura_docker_password}" | docker login -u maxura --password-stdin - cd ${WORKSPACE}/che-dashboard - docker build . -f build/dockerfiles/Dockerfile -t ${dashboardImageRepo}:${mutableDashboardImageTag} - """ - } - - withCredentials([string(credentialsId: 'quay.io-crw_pr+crw_pr_bot_user_token', variable: 'QUAY_TOKEN')]) { - sh """ - echo "Push 'che-dashboard' image" - echo "${QUAY_TOKEN}" | docker login -u="crw_pr+crw_pr_bot" --password-stdin quay.io/crw_pr - - echo y | docker push ${dashboardImageRepo}:${mutableDashboardImageTag} - """ - } - } - } - - stage("Start Che") { - steps { - script { - echo "Pre-pull test images" - withCredentials([string(credentialsId: 'ed71c034-60bc-4fb1-bfdf-9570209076b5', variable: 'maxura_docker_password')]) { - sh """ - eval \$(minikube docker-env) - - echo "${maxura_docker_password}" | docker login -u maxura --password-stdin - docker pull docker.io/traefik:v2.2.8 || true - """ - } - - - echo "Create custom-resource patch file" - if (cheSingleHost.toBoolean() == true) { - sh """cat > $CUSTOM_RESOURCE_PATCH_FILE < $CUSTOM_RESOURCE_PATCH_FILE < $LOGS_AND_CONFIGS/kubectl/events.txt || true - kubectl --namespace=eclipse-che get events -o json > $LOGS_AND_CONFIGS/kubectl/events.json || true - - mkdir -p $LOGS_AND_CONFIGS/che-config - - cp ${WORKSPACE}/org_v1_che_cr.yaml $LOGS_AND_CONFIGS/che-config || true - cp ${DEVFILE_PATH} $LOGS_AND_CONFIGS || true - cp ${CUSTOM_RESOURCE_PATCH_FILE} $LOGS_AND_CONFIGS || true - - kubectl get checluster --namespace=eclipse-che -o yaml > $LOGS_AND_CONFIGS/che-config/checluster.yaml || true - kubectl get configmaps --namespace=eclipse-che che -o yaml > $LOGS_AND_CONFIGS/che-config/configmap.yaml || true - kubectl get ingresses --namespace=eclipse-che > $LOGS_AND_CONFIGS/che-config/ingresses.txt || true - kubectl get pods --namespace=eclipse-che >$LOGS_AND_CONFIGS/che-config/pods.txt || true - kubectl get all --namespace=eclipse-che -o yaml > $LOGS_AND_CONFIGS/che-config/all.yaml || true - - mkdir -p $LOGS_AND_CONFIGS/che-logs - export PODS=\$(kubectl get pod --namespace=eclipse-che | awk 'NR>1 {print \$1}') - for pod in \$PODS ; do \ - kubectl logs --namespace=eclipse-che "\${pod}" --namespace=eclipse-che > $LOGS_AND_CONFIGS/che-logs/"\${pod}".pod.log || true; \ - done - - mkdir -p $LOGS_AND_CONFIGS/workspace-logs - export WS_POD=\$(kubectl get pod --namespace=eclipse-che | grep ".workspace-" | awk '{print \$1}') - for c in \$(kubectl get pod --namespace=eclipse-che \$WS_POD -o jsonpath="{.spec.containers[*].name}") ; do \\ - kubectl logs \$(kubectl get pod --namespace=eclipse-che | grep ".workspace-" | awk '{print \$1}') "\${c}" --namespace=eclipse-che > $LOGS_AND_CONFIGS/workspace-logs/"\${c}".container.log || true; \\ - done - kubectl describe pod --namespace=eclipse-che \$WS_POD > $LOGS_AND_CONFIGS/che-config/workspace-pod-description.txt || true - - mkdir -p $LOGS_AND_CONFIGS/docker - docker image ls > $LOGS_AND_CONFIGS/docker/images.txt || true - docker ps -a > $LOGS_AND_CONFIGS/docker/containers.txt || true - - env > $LOGS_AND_CONFIGS/env.output.txt || true - ${pathToChectl} --help > $LOGS_AND_CONFIGS/chectl.version.txt || true - - cp -r /tmp/chectl-logs $LOGS_AND_CONFIGS || true - """ - - archiveArtifacts allowEmptyArchive: true, artifacts: "tests/e2e/report/**, logs-and-configs/**" - } - - } - -} diff --git a/tests/.infra/crw-ci/master/k8s/Jenkinsfile b/tests/.infra/crw-ci/master/k8s/Jenkinsfile deleted file mode 100644 index 7b057d6388..0000000000 --- a/tests/.infra/crw-ci/master/k8s/Jenkinsfile +++ /dev/null @@ -1,159 +0,0 @@ -pipeline { - agent { label 'rhel7-8gb' } - - options { - timestamps() - timeout(time: 3, unit: 'HOURS') - buildDiscarder(logRotator(artifactDaysToKeepStr: '', - artifactNumToKeepStr: '', daysToKeepStr: '60', numToKeepStr: '30')) - } - - // build each 6 hours - triggers { cron("H H/6 * * *") } - - parameters { - string(name: 'emails', - defaultValue: 'dnochevn@redhat.com', - description: 'Comma-separated list of emails to send results') - } - - stages { - stage("Run E2E tests against master branch") { - parallel { - stage('Run Happy path tests') { - steps { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - string(name: 'cheImageRepo', - value: 'maxura/che-server'), - - string(name: 'cheImageTag', - value: 'master'), - - booleanParam(name: 'buildChe', - value: true), - - string(name: 'ghprbSourceBranch', - value: 'master'), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-happy-path'), - - string(name: 'testWorkspaceDevfileUrl', - value: 'https://raw.githubusercontent.com/eclipse/che/master/tests/e2e/files/happy-path/happy-path-workspace.yaml'), - - booleanParam(name: 'createTestWorkspace', - value: true), - - string(name: 'e2eTestParameters', - value: ''), - - string(name: 'chectlPackageUrl', - value: ''), - - string(name: 'cheE2eImageTag', - value: 'nightly') - ] - } - } - - stage('Run devfile tests') { - steps { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - string(name: 'cheImageRepo', - value: 'maxura/che-server'), - - string(name: 'cheImageTag', - value: 'master'), - - booleanParam(name: 'buildChe', - value: true), - - string(name: 'ghprbSourceBranch', - value: 'master'), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-all-devfiles'), - - string(name: 'testWorkspaceDevfileUrl', - value: ''), - - booleanParam(name: 'createTestWorkspace', - value: false), - - string(name: 'e2eTestParameters', - value: ''), - - string(name: 'chectlPackageUrl', - value: ''), - - string(name: 'cheE2eImageTag', - value: 'nightly') - ] - } - } - - stage('Run Git SSH flow tests') { - steps { - withCredentials([string(credentialsId: 'e45af3e6-8061-4d02-b187-b1c3bb133d3a', variable: 'github_oauth_token')]) { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - string(name: 'cheImageRepo', - value: 'maxura/che-server'), - - string(name: 'cheImageTag', - value: 'master'), - - booleanParam(name: 'buildChe', - value: true), - - string(name: 'ghprbSourceBranch', - value: 'master'), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-git-ssh'), - - string(name: 'testWorkspaceDevfileUrl', - value: ''), - - booleanParam(name: 'createTestWorkspace', - value: false), - - string(name: 'e2eTestParameters', - value: "-e TS_GITHUB_TEST_REPO_ACCESS_TOKEN=$github_oauth_token -e TS_GITHUB_TEST_REPO=chepullreq4/Spoon-Knife -e NODE_TLS_REJECT_UNAUTHORIZED=0"), - - string(name: 'chectlPackageUrl', - value: ''), - - string(name: 'cheE2eImageTag', - value: 'nightly') - ] - } - } - } - } - } - } - - post { - failure { - script { - if (emails != "") { - mail to: emails, - subject: "Jenkins Job $currentBuild.fullDisplayName has failed.", - body: "Build $currentBuild.absoluteUrl has failed." - } - } - } - } -} \ No newline at end of file diff --git a/tests/.infra/crw-ci/nightly/k8s/multi-host/Jenkinsfile b/tests/.infra/crw-ci/nightly/k8s/multi-host/Jenkinsfile deleted file mode 100644 index 9f0ffa2d58..0000000000 --- a/tests/.infra/crw-ci/nightly/k8s/multi-host/Jenkinsfile +++ /dev/null @@ -1,190 +0,0 @@ -pipeline { - agent { label 'rhel7-8gb' } - - options { - timestamps() - timeout(time: 6, unit: 'HOURS') - buildDiscarder(logRotator(artifactDaysToKeepStr: '', - artifactNumToKeepStr: '', daysToKeepStr: '60', numToKeepStr: '30')) - } - - triggers { cron("H 2 * * *") } - - parameters { - string(name: 'emails', - defaultValue: 'dnochevn@redhat.com,kfoniok@redhat.com', - description: 'Comma-separated list of emails to send results') - - booleanParam(name: 'cheSingleHost', - defaultValue: false, - description: 'Configuration Che server strategy') - } - - stages { - stage("Run E2E tests") { - steps { - script { - catchError(buildResult: 'UNSTABLE', stageResult: 'FAILED') { - stage('Run Happy path tests') { - retry(2) { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - booleanParam(name: 'cheSingleHost', - value: cheSingleHost.toBoolean()), - - string(name: 'cheImageRepo', - value: 'quay.io/eclipse/che-server'), - - string(name: 'cheImageTag', - value: 'nightly'), - - booleanParam(name: 'buildChe', - value: false), - - string(name: 'ghprbSourceBranch', - value: 'master'), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-happy-path'), - - string(name: 'testWorkspaceDevfileUrl', - value: 'https://raw.githubusercontent.com/eclipse/che/master/tests/e2e/files/happy-path/happy-path-workspace.yaml'), - - booleanParam(name: 'createTestWorkspace', - value: true), - - string(name: 'e2eTestParameters', - value: ''), - - string(name: 'chectlPackageUrl', - value: ''), - - string(name: 'cheE2eImageTag', - value: 'nightly') - ] - } - } - } - - catchError(buildResult: 'UNSTABLE', stageResult: 'FAILED') { - stage('Run devfile tests') { - retry(2) { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - booleanParam(name: 'cheSingleHost', - value: cheSingleHost.toBoolean()), - - string(name: 'cheImageRepo', - value: 'quay.io/eclipse/che-server'), - - string(name: 'cheImageTag', - value: 'nightly'), - - booleanParam(name: 'buildChe', - value: false), - - string(name: 'ghprbSourceBranch', - value: 'master'), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-all-devfiles'), - - string(name: 'testWorkspaceDevfileUrl', - value: ''), - - booleanParam(name: 'createTestWorkspace', - value: false), - - string(name: 'e2eTestParameters', - value: ''), - - string(name: 'chectlPackageUrl', - value: ''), - - string(name: 'cheE2eImageTag', - value: 'nightly') - ] - } - } - } - - catchError(buildResult: 'UNSTABLE', stageResult: 'FAILED') { - stage('Run Git SSH flow tests') { - retry(2) { - withCredentials([string(credentialsId: 'e45af3e6-8061-4d02-b187-b1c3bb133d3a', variable: 'github_oauth_token')]) { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - booleanParam(name: 'cheSingleHost', - value: cheSingleHost.toBoolean()), - - string(name: 'cheImageRepo', - value: 'quay.io/eclipse/che-server'), - - string(name: 'cheImageTag', - value: 'nightly'), - - booleanParam(name: 'buildChe', - value: false), - - string(name: 'ghprbSourceBranch', - value: 'master'), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-git-ssh'), - - string(name: 'testWorkspaceDevfileUrl', - value: ''), - - booleanParam(name: 'createTestWorkspace', - value: false), - - string(name: 'e2eTestParameters', - value: "-e TS_SELENIUM_LOAD_PAGE_TIMEOUT=30000 -e TS_GITHUB_TEST_REPO_ACCESS_TOKEN=$github_oauth_token -e TS_GITHUB_TEST_REPO=chepullreq4/Spoon-Knife -e NODE_TLS_REJECT_UNAUTHORIZED=0"), - - string(name: 'chectlPackageUrl', - value: ''), - - string(name: 'cheE2eImageTag', - value: 'nightly') - ] - } - } - } - } - } - } - } - - } - - post { - success { - script { - if (emails != "") { - mail to: emails, - subject: "Jenkins Job $currentBuild.fullDisplayName has passed successfully.", - body: "Build $currentBuild.absoluteUrl has passed successfully." - } - } - } - - failure { - script { - if (emails != "") { - mail to: emails, - subject: "Jenkins Job $currentBuild.fullDisplayName has failed.", - body: "Build $currentBuild.absoluteUrl has failed." - } - } - } - } -} diff --git a/tests/.infra/crw-ci/nightly/k8s/single-host/Jenkinsfile b/tests/.infra/crw-ci/nightly/k8s/single-host/Jenkinsfile deleted file mode 100644 index 57745d743a..0000000000 --- a/tests/.infra/crw-ci/nightly/k8s/single-host/Jenkinsfile +++ /dev/null @@ -1,186 +0,0 @@ -pipeline { - agent { label 'rhel7-8gb' } - - options { - timestamps() - timeout(time: 6, unit: 'HOURS') - buildDiscarder(logRotator(artifactDaysToKeepStr: '', - artifactNumToKeepStr: '', daysToKeepStr: '60', numToKeepStr: '30')) - } - - triggers { cron("H 1 * * *") } - - parameters { - string(name: 'emails', - defaultValue: 'dnochevn@redhat.com, oshmarai@redhat.com', - description: 'Comma-separated list of emails to send results') - } - - stages { - stage("Run E2E tests") { - steps { - script { - catchError(buildResult: 'UNSTABLE', stageResult: 'FAILED') { - stage('Run Happy path tests') { - retry(2) { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - booleanParam(name: 'cheSingleHost', - value: true), - - string(name: 'cheImageRepo', - value: 'quay.io/eclipse/che-server'), - - string(name: 'cheImageTag', - value: 'nightly'), - - booleanParam(name: 'buildChe', - value: false), - - string(name: 'ghprbSourceBranch', - value: 'master'), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-happy-path'), - - string(name: 'testWorkspaceDevfileUrl', - value: 'https://raw.githubusercontent.com/eclipse/che/master/tests/e2e/files/happy-path/happy-path-workspace.yaml'), - - booleanParam(name: 'createTestWorkspace', - value: true), - - string(name: 'e2eTestParameters', - value: ''), - - string(name: 'chectlPackageUrl', - value: ''), - - string(name: 'cheE2eImageTag', - value: 'nightly') - ] - } - } - } - - catchError(buildResult: 'UNSTABLE', stageResult: 'FAILED') { - stage('Run devfile tests') { - retry(2) { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - booleanParam(name: 'cheSingleHost', - value: true), - - string(name: 'cheImageRepo', - value: 'quay.io/eclipse/che-server'), - - string(name: 'cheImageTag', - value: 'nightly'), - - booleanParam(name: 'buildChe', - value: false), - - string(name: 'ghprbSourceBranch', - value: 'master'), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-all-devfiles'), - - string(name: 'testWorkspaceDevfileUrl', - value: ''), - - booleanParam(name: 'createTestWorkspace', - value: false), - - string(name: 'e2eTestParameters', - value: ''), - - string(name: 'chectlPackageUrl', - value: ''), - - string(name: 'cheE2eImageTag', - value: 'nightly') - ] - } - } - } - - catchError(buildResult: 'UNSTABLE', stageResult: 'FAILED') { - stage('Run Git SSH flow tests') { - retry(2) { - withCredentials([string(credentialsId: 'e45af3e6-8061-4d02-b187-b1c3bb133d3a', variable: 'github_oauth_token')]) { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - booleanParam(name: 'cheSingleHost', - value: true), - - string(name: 'cheImageRepo', - value: 'quay.io/eclipse/che-server'), - - string(name: 'cheImageTag', - value: 'nightly'), - - booleanParam(name: 'buildChe', - value: false), - - string(name: 'ghprbSourceBranch', - value: 'master'), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-git-ssh'), - - string(name: 'testWorkspaceDevfileUrl', - value: ''), - - booleanParam(name: 'createTestWorkspace', - value: false), - - string(name: 'e2eTestParameters', - value: "-e TS_GITHUB_TEST_REPO_ACCESS_TOKEN=$github_oauth_token -e TS_GITHUB_TEST_REPO=chepullreq4/Spoon-Knife -e NODE_TLS_REJECT_UNAUTHORIZED=0"), - - string(name: 'chectlPackageUrl', - value: ''), - - string(name: 'cheE2eImageTag', - value: 'nightly') - ] - } - } - } - } - } - } - } - - } - - post { - success { - script { - if (emails != "") { - mail to: emails, - subject: "Jenkins Job $currentBuild.fullDisplayName has passed successfully.", - body: "Build $currentBuild.absoluteUrl has passed successfully." - } - } - } - - failure { - script { - if (emails != "") { - mail to: emails, - subject: "Jenkins Job $currentBuild.fullDisplayName has failed.", - body: "Build $currentBuild.absoluteUrl has failed." - } - } - } - } -} diff --git a/tests/.infra/crw-ci/pr-check/k8s/Jenkinsfile b/tests/.infra/crw-ci/pr-check/k8s/Jenkinsfile deleted file mode 100644 index 407e6a3a5e..0000000000 --- a/tests/.infra/crw-ci/pr-check/k8s/Jenkinsfile +++ /dev/null @@ -1,433 +0,0 @@ -#!groovy - -pipeline { - agent { label "minikube-rhel7-8gb" } - - options { - timestamps() - timeout(time: 90, unit: 'MINUTES') - buildDiscarder(logRotator(artifactDaysToKeepStr: '', - artifactNumToKeepStr: '', daysToKeepStr: '60', numToKeepStr: '100')) - } - - environment { - PATH = "/tmp:/qa/tools/opt/apache-maven-3.6.1/bin:/qa/tools/opt/openjdk-11.0.6.10/bin:$PATH" - JAVA_HOME="/qa/tools/opt/openjdk-11.0.6.10" - JENKINS_BUILD = "true" - - DEVFILE_PATH = "${WORKSPACE}/test-workspace-devfile.yaml" - CUSTOM_RESOURCE_PATCH_FILE = "${WORKSPACE}/custom-resource-patch.yaml" - - SUCCESS_THRESHOLD = 5 - - LOGS_AND_CONFIGS ="${WORKSPACE}/logs-and-configs" - - mutableCheImageTag = "" - pathToChectl = "" - } - - parameters { - booleanParam(name: 'cheSingleHost', - defaultValue: false, - description: 'Configuration Che server strategy') - - string(name: 'cheImageRepo', - defaultValue: "quay.io/crw_pr/che-server", - description: 'Repo of Che server image') - - string(name: 'cheImageTag', - defaultValue: "", - description: 'Tag of Che server image') - - booleanParam(name: 'buildChe', - defaultValue: false, - description: 'Should build Che server') - - string(name: 'e2eTestToRun', - defaultValue: "test-happy-path", - description: 'TypeScript E2E test to run') - - string(name: 'testWorkspaceDevfileUrl', - defaultValue: "", - description: 'URL of devfile of test workspace') - - booleanParam(name: 'createTestWorkspace', - defaultValue: true, - description: 'Should create test workspace') - - string(name: 'ghprbSourceBranch', - defaultValue: "master") - - string(name: 'e2eTestParameters', - defaultValue: "") - - string( - name: "chectlPackageUrl", - defaultValue: "", - description: "URL address of chectl package" - ) - - string( - name: "cheE2eImageTag", - defaultValue: "nightly", - description: "Tag of quay.io/eclipse/che-e2e image" - ) - } - - stages { - stage("Setup environment") { - steps { - script { - if (cheImageTag == null || cheImageTag == '') { - mutableCheImageTag = ghprbPullId - } else { - mutableCheImageTag = cheImageTag - } - } - } - } - - stage("Prepare to start Che on K8S") { - failFast true - - parallel { - stage("Download chectl") { - steps { - script { - retry(2) { - if (chectlPackageUrl != "") { - sh """ - wget ${chectlPackageUrl} -O chectl-linux-x64.tar.gz - tar -xzf chectl-linux-x64.tar.gz - """ - pathToChectl = "${WORKSPACE}/chectl/bin/chectl" - - } else { - echo "Install chectl using https://www.eclipse.org/che/chectl/ --channel=next" - sh """ - curl -sL https://www.eclipse.org/che/chectl/ > install_chectl.sh - chmod +x install_chectl.sh - sudo PATH=$PATH ./install_chectl.sh --channel=next - sudo mv /usr/local/bin/chectl ${WORKSPACE}/chectl - sudo chmod +x ${WORKSPACE}/chectl - """ - pathToChectl = "${WORKSPACE}/chectl" - } - } - } - } - } - - stage("Start Kubernetes") { - steps { - script { - retry(2) { - echo "Workaround k8s error https://github.com/eclipse/che/issues/14902" - sh """ - cat /etc/sysctl.conf - echo "net.bridge.bridge-nf-call-iptables = 1" | sudo tee -a /etc/sysctl.conf - sudo sysctl -p - """ - - sh """ - # https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md - export MINIKUBE_WANTUPDATENOTIFICATION=false - export MINIKUBE_WANTREPORTERRORPROMPT=false - export MINIKUBE_HOME=\$HOME - export CHANGE_MINIKUBE_NONE_USER=true - export KUBECONFIG=\$HOME/.kube/config - export DOCKER_CONFIG=\$HOME/.docker - - mkdir -p \$HOME/.kube \$HOME/.minikube - touch \$KUBECONFIG - - sudo -E /usr/local/bin/minikube start \\ - --vm-driver=none \\ - --cpus 2 \\ - --memory 6500 \\ - --logtostderr - """ - } - } - } - } - - stage("Build Che including upstream projects") { - when { - expression { - return buildChe.toString() == 'true' || (params['ghprbCommentBody'] && (params.ghprbCommentBody == 'null' || params.ghprbCommentBody.contains("--rebuild"))) - } - } - - steps { - echo "Build branch ${ghprbSourceBranch} of upstream projects" - sh """ - project_list=( - eclipse/che-parent - ) - - for project in \${project_list[@]}; - do - result=\$(git ls-remote --heads https://github.com/\${project}.git ${ghprbSourceBranch}) - if [[ \$result == *"refs"* ]]; then - echo "[PRE-BUILD CHECK] found upstream project: \${project} with same branch name: ${ghprbSourceBranch}" - git clone -b ${ghprbSourceBranch} https://github.com/\${project} \${project} - mvn clean install -f ${WORKSPACE}/\${project}/pom.xml -DskipTests - else - echo "[PRE-BUILD CHECK] skip build upstream project: \$project, unable to find branch: ${ghprbSourceBranch}." - fi - done - """ - - echo "Build Che" - sh "mvn clean install -f ${WORKSPACE}/pom.xml -T 4 -U -DskipTests -Dskip-enforce -Dskip-validate-sources" - } - } - - stage("Pull test images") { - steps { - script { - retry(2) { - echo "Pull test images" - sh """ - docker pull quay.io/eclipse/che-e2e:$cheE2eImageTag - docker pull quay.io/eclipse/happy-path:nightly - """ - } - } - } - } - } - } - - stage("Build and push che-server image") { - when { - expression { - return buildChe.toString() == 'true' || (params['ghprbCommentBody'] && (params.ghprbCommentBody == 'null' || params.ghprbCommentBody.contains("--rebuild"))) - } - } - - steps { - withCredentials([string(credentialsId: 'ed71c034-60bc-4fb1-bfdf-9570209076b5', variable: 'maxura_docker_password')]) { - sh """ - echo "Build 'che-server' image" - echo "${maxura_docker_password}" | docker login -u maxura --password-stdin - - ${WORKSPACE}/dockerfiles/che/build.sh --organization:eclipseche --tag:${mutableCheImageTag} --dockerfile:Dockerfile - """ - } - - withCredentials([string(credentialsId: 'quay.io-crw_pr+crw_pr_bot_user_token', variable: 'QUAY_TOKEN')]) { - sh """ - echo "Push 'che-server' image" - echo "${QUAY_TOKEN}" | docker login -u="crw_pr+crw_pr_bot" --password-stdin quay.io/crw_pr - - docker tag eclipseche/che-server:${mutableCheImageTag} ${cheImageRepo}:${mutableCheImageTag} - echo y | docker push ${cheImageRepo}:${mutableCheImageTag} - """ - } - } - } - - stage("Start Che") { - steps { - script { - echo "Pre-pull test images" - withCredentials([string(credentialsId: 'ed71c034-60bc-4fb1-bfdf-9570209076b5', variable: 'maxura_docker_password')]) { - sh """ - eval \$(minikube docker-env) - - docker pull ${cheImageRepo}:${mutableCheImageTag} - - echo "${maxura_docker_password}" | docker login -u="maxura" --password-stdin docker.io - docker pull docker.io/traefik:v2.2.8 || true - """ - } - - - echo "Create custom-resource patch file" - if (cheSingleHost.toBoolean() == true) { - sh """cat > $CUSTOM_RESOURCE_PATCH_FILE < $CUSTOM_RESOURCE_PATCH_FILE < $LOGS_AND_CONFIGS/kubectl/events.txt || true - kubectl --namespace=eclipse-che get events -o json > $LOGS_AND_CONFIGS/kubectl/events.json || true - kubectl get pods -A >$LOGS_AND_CONFIGS/kubectl/pods.txt || true - - mkdir -p $LOGS_AND_CONFIGS/che-config - - cp ${WORKSPACE}/org_v1_che_cr.yaml $LOGS_AND_CONFIGS/che-config || true - cp ${DEVFILE_PATH} $LOGS_AND_CONFIGS || true - cp ${CUSTOM_RESOURCE_PATCH_FILE} $LOGS_AND_CONFIGS || true - - kubectl get checluster --namespace=eclipse-che -o yaml > $LOGS_AND_CONFIGS/che-config/checluster.yaml || true - kubectl get configmaps --namespace=eclipse-che che -o yaml > $LOGS_AND_CONFIGS/che-config/configmap.yaml || true - kubectl get ingresses --namespace=eclipse-che > $LOGS_AND_CONFIGS/che-config/ingresses.txt || true - kubectl get pods --namespace=eclipse-che >$LOGS_AND_CONFIGS/che-config/pods.txt || true - kubectl get all --namespace=eclipse-che -o yaml > $LOGS_AND_CONFIGS/che-config/all.yaml || true - - mkdir -p $LOGS_AND_CONFIGS/che-logs - export PODS=\$(kubectl get pod --namespace=eclipse-che | awk 'NR>1 {print \$1}') - for pod in \$PODS ; do \ - kubectl logs --namespace=eclipse-che "\${pod}" --namespace=eclipse-che > $LOGS_AND_CONFIGS/che-logs/"\${pod}".pod.log || true; \ - done - kubectl describe pod --namespace=eclipse-che > $LOGS_AND_CONFIGS/che-config/eclipse-che-pod-description.txt || true - - mkdir -p $LOGS_AND_CONFIGS/workspace-logs - WORKSPACE_NAMESPACE_NAME=admin-che - export WS_POD=\$(kubectl get pod --namespace=\$WORKSPACE_NAMESPACE_NAME | grep ".workspace-" | awk '{print \$1}') - for c in \$(kubectl get pod --namespace=\$WORKSPACE_NAMESPACE_NAME \$WS_POD -o jsonpath="{.spec.containers[*].name}") ; do - CONTAINER_LOGS_DIR=$LOGS_AND_CONFIGS/workspace-logs/"\${c}" - mkdir \$CONTAINER_LOGS_DIR - kubectl logs \$WS_POD "\${c}" --namespace=\$WORKSPACE_NAMESPACE_NAME > \${CONTAINER_LOGS_DIR}.container.log || true; - kubectl cp \$WORKSPACE_NAMESPACE_NAME/\$WS_POD:/workspace_logs \$CONTAINER_LOGS_DIR -c "\${c}" || true; - done - kubectl describe pod --namespace=\$WORKSPACE_NAMESPACE_NAME \$WS_POD > $LOGS_AND_CONFIGS/che-config/workspace-pod-description.txt || true - - mkdir -p $LOGS_AND_CONFIGS/docker - docker image ls > $LOGS_AND_CONFIGS/docker/images.txt || true - docker ps -a > $LOGS_AND_CONFIGS/docker/containers.txt || true - - env > $LOGS_AND_CONFIGS/env.output.txt || true - ${pathToChectl} --help > $LOGS_AND_CONFIGS/chectl.version.txt || true - - cp -r /tmp/chectl-logs $LOGS_AND_CONFIGS || true - cp /home/hudson/.cache/chectl/error.log /tmp/chectl-logs || true - """ - - archiveArtifacts allowEmptyArchive: true, artifacts: "tests/e2e/report/**, logs-and-configs/**" - } - - } - -} \ No newline at end of file diff --git a/tests/.infra/crw-ci/release-testing/k8s/Jenkinsfile b/tests/.infra/crw-ci/release-testing/k8s/Jenkinsfile deleted file mode 100644 index 2c236b3bef..0000000000 --- a/tests/.infra/crw-ci/release-testing/k8s/Jenkinsfile +++ /dev/null @@ -1,194 +0,0 @@ -pipeline { - agent { label 'rhel7-8gb' } - - options { - timestamps() - timeout(time: 3, unit: 'HOURS') - buildDiscarder(logRotator(artifactDaysToKeepStr: '', - artifactNumToKeepStr: '', daysToKeepStr: '60', numToKeepStr: '30')) - } - - environment { - YQ_TOOL_URL='https://github.com/mikefarah/yq/releases/download/2.4.0/yq_linux_amd64' - - DEVFILE_URL="${WORKSPACE}/happy-path-workspace.yaml" - } - - parameters { - string(name: 'RELEASE_BRANCH', - defaultValue: "7.12.x", - description: 'Branch with pre-release version to take E2E Happy path test.') - - string(name: 'RELEASE_VERSION', - defaultValue: "7.12.1", - description: 'Version of Che-theia') - - string(name: 'CHECTL_PACKAGE_URL', - defaultValue: "https://github.com/che-incubator/chectl/releases/download/20200501092240/chectl-linux-x64.tar.gz", - description: 'URL address of chectl package tar ball') - } - - stages { - stage('Prepare Happy path devfile') { - steps { - withCredentials([string(credentialsId: 'e45af3e6-8061-4d02-b187-b1c3bb133d3a', variable: 'GITHUB_TOKEN')]) { - sh """ - CHE_THEIA_META_YAML_URL='https://raw.githubusercontent.com/eclipse/che-plugin-registry/$RELEASE_BRANCH/v3/plugins/eclipse/che-theia/next/meta.yaml' - - wget https://raw.githubusercontent.com/eclipse/che/$RELEASE_BRANCH/tests/e2e/files/happy-path/happy-path-workspace.yaml --no-check-certificate -O $DEVFILE_URL - - PR_CHECK_FILES_DIR=${WORKSPACE}/pr-check-files/che/$RELEASE_VERSION - PR_CHECK_FILES_GITHUB_URL="https://raw.githubusercontent.com/chepullreq4/pr-check-files/master/che/$RELEASE_VERSION" - - git clone https://chepullreq4:${GITHUB_TOKEN}@github.com/chepullreq4/pr-check-files.git - mkdir -p \$PR_CHECK_FILES_DIR - - wget $YQ_TOOL_URL - sudo chmod +x yq_linux_amd64 - - wget \$CHE_THEIA_META_YAML_URL -O \$PR_CHECK_FILES_DIR/che_theia_meta.yaml - ./yq_linux_amd64 w -i \$PR_CHECK_FILES_DIR/che_theia_meta.yaml spec.containers[0].image quay.io/eclipse/che-theia:$RELEASE_VERSION - ./yq_linux_amd64 w -i \$PR_CHECK_FILES_DIR/che_theia_meta.yaml spec.initContainers[0].image quay.io/eclipse/che-theia-endpoint-runtime-binary:$RELEASE_VERSION - - # patch che/tests/e2e/files/happy-path/happy-path-workspace.yaml - sed -i "s|id: eclipse/che-theia/next|alias: che-theia\\n reference: \$PR_CHECK_FILES_GITHUB_URL/che_theia_meta.yaml|" $DEVFILE_URL - - cat $DEVFILE_URL - - cp $DEVFILE_URL \${PR_CHECK_FILES_DIR} - cd \${PR_CHECK_FILES_DIR} - git add -A - git diff-index --quiet HEAD || git commit -m "Che $RELEASE_VERSION files for pre-release testing on Jenkins $JOB_URL" - git push - """ - } - } - } - - stage("Run E2E tests") { - parallel { - stage('Run Happy path tests against Eclipse Che release candidate') { - steps { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - string(name: 'cheImageRepo', - value: 'quay.io/eclipse/che-server'), - - string(name: 'cheImageTag', - value: RELEASE_VERSION), - - booleanParam(name: 'buildChe', - value: false), - - string(name: 'ghprbSourceBranch', - value: RELEASE_BRANCH), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-happy-path'), - - string(name: 'testWorkspaceDevfileUrl', - value: "https://raw.githubusercontent.com/chepullreq4/pr-check-files/master/che/$RELEASE_VERSION/happy-path-workspace.yaml"), - - booleanParam(name: 'createTestWorkspace', - value: true), - - string(name: 'e2eTestParameters', - value: ''), - - string(name: 'chectlPackageUrl', - value: CHECTL_PACKAGE_URL), - - string(name: 'cheE2eImageTag', - value: RELEASE_VERSION) - ] - } - } - - stage('Run devfile tests against Eclipse Che release candidate') { - steps { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - string(name: 'cheImageRepo', - value: 'quay.io/eclipse/che-server'), - - string(name: 'cheImageTag', - value: RELEASE_VERSION), - - booleanParam(name: 'buildChe', - value: false), - - string(name: 'ghprbSourceBranch', - value: RELEASE_BRANCH), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-all-devfiles'), - - string(name: 'testWorkspaceDevfileUrl', - value: ""), - - booleanParam(name: 'createTestWorkspace', - value: false), - - string(name: 'e2eTestParameters', - value: ''), - - string(name: 'chectlPackageUrl', - value: CHECTL_PACKAGE_URL), - - string(name: 'cheE2eImageTag', - value: RELEASE_VERSION) - ] - } - } - - stage('Run Git SSH flow tests') { - steps { - withCredentials([string(credentialsId: 'e45af3e6-8061-4d02-b187-b1c3bb133d3a', variable: 'github_oauth_token')]) { - build job: 'basic-MultiUser-Che-check-e2e-tests-against-k8s', - parameters: [ - string(name: 'cheImageRepo', - value: 'quay.io/eclipse/che-server'), - - string(name: 'cheImageTag', - value: RELEASE_VERSION), - - booleanParam(name: 'buildChe', - value: false), - - string(name: 'ghprbSourceBranch', - value: RELEASE_BRANCH), - - string(name: 'ghprbPullId', - value: ''), - - string(name: 'e2eTestToRun', - value: 'test-git-ssh'), - - string(name: 'testWorkspaceDevfileUrl', - value: ''), - - booleanParam(name: 'createTestWorkspace', - value: false), - - string(name: 'e2eTestParameters', - value: "-e TS_GITHUB_TEST_REPO_ACCESS_TOKEN=$github_oauth_token -e TS_GITHUB_TEST_REPO=chepullreq4/Spoon-Knife -e NODE_TLS_REJECT_UNAUTHORIZED=0"), - - string(name: 'chectlPackageUrl', - value: CHECTL_PACKAGE_URL), - - string(name: 'cheE2eImageTag', - value: RELEASE_VERSION) - ] - } - } - } - } - } - } -} \ No newline at end of file