Skip to content

Commit

Permalink
Adapt automated E2E pre-release tests to verify Che 7.12.1 (#16829)
Browse files Browse the repository at this point in the history
* Adapt automated E2E pre-release tests to check already released version of Eclipse Che

Signed-off-by: Dmytro Nochevnov <dnochevn@redhat.com>

* Remove failing 'setupReleaseVersionAndTag' method

Signed-off-by: Dmytro Nochevnov <dnochevn@redhat.com>
  • Loading branch information
dmytro-ndp committed May 4, 2020
1 parent 3621e78 commit 958c0d4
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 66 deletions.
13 changes: 0 additions & 13 deletions tests/.infra/centos-ci/functional_tests_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -438,16 +438,3 @@ function runDevfileTestSuite() {
-e TS_SELENIUM_WORKSPACE_STATUS_POLLING=20000 \
quay.io/eclipse/che-e2e:nightly || IS_TESTS_FAILED=true
}

function getReleaseVersion() {
echo $(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d'-' -f1) #cut SNAPSHOT from the version name
}

function setupReleaseVersionAndTag() {
echo "======== Starting Che RC test job $(date) ========"
RELEASE_VERSION=$(getReleaseVersion)
RELEASE_TAG="rc"

echo "======== Release version:" ${RELEASE_VERSION}
echo "======== Release tag:" ${RELEASE_TAG}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ source tests/.infra/centos-ci/rc/rc_function_util.sh
setupEnvs
installKVM
installDependencies
setupReleaseVersionAndTag
installAndStartMinishift
loginToOpenshiftAndSetDevRole
prepareCustomResourceFile false
installCheCtl
installReleaseCheCtl
deployCheIntoCluster --che-operator-cr-yaml=/tmp/custom-resource.yaml
createTestUserAndObtainUserToken
createTestWorkspaceAndRunTest --devfile=https://raw.githubusercontent.com/eclipse/che/cico-rc-test/tests/e2e/files/happy-path/happy-path-workspace.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ source tests/.infra/centos-ci/rc/rc_function_util.sh

setupEnvs
installDependencies
setupReleaseVersionAndTag
installDockerCompose
installKVM
installAndStartMinishift
loginToOpenshiftAndSetDevRole
prepareCustomResourceFile false
installCheCtl
installReleaseCheCtl
deployCheIntoCluster --chenamespace=eclipse-che --che-operator-cr-yaml=/tmp/custom-resource.yaml
createIndentityProvider
seleniumTestsSetup
Expand Down
3 changes: 1 addition & 2 deletions tests/.infra/centos-ci/rc/cico-rc-ocp-oauth-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ source tests/.infra/centos-ci/rc/rc_function_util.sh

setupEnvs
installDependencies
setupReleaseVersionAndTag
installDockerCompose
installKVM
installAndStartMinishift
loginToOpenshiftAndSetDevRole
prepareCustomResourceFile true
installCheCtl
installReleaseCheCtl
deployCheIntoCluster --chenamespace=eclipse-che --che-operator-cr-yaml=/tmp/custom-resource.yaml
seleniumTestsSetup

Expand Down
3 changes: 1 addition & 2 deletions tests/.infra/centos-ci/rc/cico-rc-rolling-strategy-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ source tests/.infra/centos-ci/rc/rc_function_util.sh

setupEnvs
installDependencies
setupReleaseVersionAndTag
installDockerCompose
installKVM
installAndStartMinishift
loginToOpenshiftAndSetDevRole
prepareCustomResourceFile false
installCheCtl
installReleaseCheCtl
deployCheIntoCluster --chenamespace=eclipse-che --che-operator-cr-yaml=/tmp/custom-resource.yaml
seleniumTestsSetup

Expand Down
17 changes: 14 additions & 3 deletions tests/.infra/centos-ci/rc/rc_function_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,29 @@
# http://www.eclipse.org/legal/epl-v10.html

function prepareCustomResourceFile() {
RELEASE_VERSION=7.12.1
echo "======== Patch custom-resource.yaml ========"
cd /tmp
wget https://raw.githubusercontent.com/eclipse/che-operator/master/deploy/crds/org_v1_che_cr.yaml -O custom-resource.yaml
wget https://raw.githubusercontent.com/eclipse/che-operator/$RELEASE_VERSION/deploy/crds/org_v1_che_cr.yaml -O custom-resource.yaml
setOpenShiftoAuth=$1 # sets the value of 'openShiftoAuth' parameter
sed -i "s@openShiftoAuth: false@openShiftoAuth: $1@g" /tmp/custom-resource.yaml
sed -i "s@server:@server:\n customCheProperties:\n CHE_LIMITS_USER_WORKSPACES_RUN_COUNT: '-1'@g" /tmp/custom-resource.yaml
sed -i "s/customCheProperties:/customCheProperties:\n CHE_WORKSPACE_AGENT_DEV_INACTIVE__STOP__TIMEOUT__MS: '300000'/" /tmp/custom-resource.yaml
sed -i "s@identityProviderImage: 'quay.io/eclipse/che-keycloak:nightly'@identityProviderImage: 'quay.io/eclipse/che-keycloak:$RELEASE_TAG'@g" /tmp/custom-resource.yaml
sed -i "s@identityProviderImage: 'quay.io/eclipse/che-keycloak:nightly'@identityProviderImage: 'quay.io/eclipse/che-keycloak:$RELEASE_VERSION'@g" /tmp/custom-resource.yaml
sed -i "s@cheImage: ''@cheImage: 'quay.io/eclipse/che-server'@g" /tmp/custom-resource.yaml
sed -i "s@cheImageTag: 'nightly'@cheImageTag: '$RELEASE_TAG'@g" /tmp/custom-resource.yaml
sed -i "s@cheImageTag: 'nightly'@cheImageTag: '$RELEASE_VERSION'@g" /tmp/custom-resource.yaml
sed -i "s@devfileRegistryImage: 'quay.io/eclipse/che-devfile-registry:nightly'@devfileRegistryImage: 'quay.io/eclipse/che-devfile-registry:$RELEASE_VERSION'@g" /tmp/custom-resource.yaml
sed -i "s@pluginRegistryImage: 'quay.io/eclipse/che-plugin-registry:nightly'@pluginRegistryImage: 'quay.io/eclipse/che-plugin-registry:$RELEASE_VERSION'@g " /tmp/custom-resource.yaml
sed -i "s@tlsSupport: true@tlsSupport: false@g" /tmp/custom-resource.yaml
cat /tmp/custom-resource.yaml
}

function installReleaseCheCtl() {
# 7.12.1 chectl
releaseChectlPackageUrl=https://github.com/che-incubator/chectl/releases/download/20200501092240/chectl-linux-x64.tar.gz

cd /tmp
wget ${releaseChectlPackageUrl} -O chectl-linux-x64.tar.gz
tar -xzf chectl-linux-x64.tar.gz
export PATH=$PATH:/tmp/chectl/bin
}
24 changes: 21 additions & 3 deletions tests/.infra/crw-ci/master/k8s/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ pipeline {
value: true),

string(name: 'e2eTestParameters',
value: '')
value: ''),

string(name: 'chectlPackageUrl',
value: ''),

string(name: 'cheE2eImageTag',
value: 'nightly')
]
}
}
Expand Down Expand Up @@ -89,7 +95,13 @@ pipeline {
value: false),

string(name: 'e2eTestParameters',
value: '')
value: ''),

string(name: 'chectlPackageUrl',
value: ''),

string(name: 'cheE2eImageTag',
value: 'nightly')
]
}
}
Expand Down Expand Up @@ -127,7 +139,13 @@ pipeline {
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")
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')
]
}
}
Expand Down
24 changes: 21 additions & 3 deletions tests/.infra/crw-ci/nightly/k8s/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ pipeline {
value: true),

string(name: 'e2eTestParameters',
value: '')
value: ''),

string(name: 'chectlPackageUrl',
value: ''),

string(name: 'cheE2eImageTag',
value: 'nightly')
]
}
}
Expand Down Expand Up @@ -88,7 +94,13 @@ pipeline {
value: false),

string(name: 'e2eTestParameters',
value: '')
value: ''),

string(name: 'chectlPackageUrl',
value: ''),

string(name: 'cheE2eImageTag',
value: 'nightly')
]
}
}
Expand Down Expand Up @@ -126,7 +138,13 @@ pipeline {
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")
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')
]
}
}
Expand Down
54 changes: 37 additions & 17 deletions tests/.infra/crw-ci/pr-check/k8s/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pipeline {
LOGS_AND_CONFIGS ="${WORKSPACE}/logs-and-configs"

mutableCheImageTag = ""
pathToChectl = ""
}

parameters {
Expand Down Expand Up @@ -58,6 +59,18 @@ pipeline {

string(name: 'e2eTestParameters',
defaultValue: "")

string(
name: "chectlPackageUrl",
defaultValue: "https://github.com/che-incubator/chectl/releases/download/20200424063811/chectl-linux-x64.tar.gz",
description: "URL address of chectl package"
)

string(
name: "cheE2eImageTag",
defaultValue: "nightly",
description: "Tag of quay.io/eclipse/che-e2e image"
)
}

stages {
Expand Down Expand Up @@ -91,14 +104,24 @@ pipeline {
steps {
script {
retry(2) {
// TO-DO use option "--install-path" https://github.com/eclipse/che/pull/14182
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
"""
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"
}
}
}
}
Expand Down Expand Up @@ -177,7 +200,7 @@ pipeline {
script {
retry(2) {
sh """
docker pull quay.io/eclipse/che-e2e:nightly
docker pull quay.io/eclipse/che-e2e:$cheE2eImageTag
docker pull quay.io/eclipse/happy-path:nightly
"""
}
Expand Down Expand Up @@ -214,16 +237,13 @@ pipeline {
sed -i "s|cheLogLevel: INFO|cheLogLevel: DEBUG|" $CUSTOM_RESOURCE_FILE_PATH
sed -i "s|ingressDomain: '192.168.99.101.nip.io'|ingressDomain: '\$(minikube ip).nip.io'|" $CUSTOM_RESOURCE_FILE_PATH
# temporary workaround to https://github.com/eclipse/che/issues/16292
sed -i "s/tlsSupport: true/tlsSupport: false/" $CUSTOM_RESOURCE_FILE_PATH
# TODO: "selfSignedCert: true" so as TLS support is enebled by default
# sed -i "s/selfSignedCert: false/selfSignedCert: true/" $CUSTOM_RESOURCE_FILE_PATH
sed -i "s/selfSignedCert: false/selfSignedCert: true/" $CUSTOM_RESOURCE_FILE_PATH
"""

echo "Install Che"
sh """
${WORKSPACE}/chectl server:start \\
${pathToChectl} server:start \\
--k8spodreadytimeout=180000 \\
--installer=operator \\
--listr-renderer=verbose \\
Expand Down Expand Up @@ -291,7 +311,7 @@ pipeline {
-d "grant_type=password" \\
-d "client_id=che-public" | jq -r .access_token)
${WORKSPACE}/chectl workspace:create --start \\
${pathToChectl} workspace:create --start \\
--devfile=${DEVFILE_PATH} \\
--access-token "\$USER_ACCESS_TOKEN"
"""
Expand All @@ -316,7 +336,7 @@ pipeline {
-e TEST_SUITE="${e2eTestToRun}" ${e2eTestParameters} \\
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \\
-v ${WORKSPACE}/tests/e2e:/tmp/e2e:Z \\
quay.io/eclipse/che-e2e:nightly
quay.io/eclipse/che-e2e:${cheE2eImageTag}
"""
}
}
Expand Down Expand Up @@ -359,7 +379,7 @@ pipeline {
docker ps -a > $LOGS_AND_CONFIGS/docker/containers.txt || true
env > $LOGS_AND_CONFIGS/env.output.txt || true
${WORKSPACE}/chectl --help > $LOGS_AND_CONFIGS/chectl.version.txt || true
${pathToChectl} --help > $LOGS_AND_CONFIGS/chectl.version.txt || true
cp -r /tmp/chectl-logs $LOGS_AND_CONFIGS || true
"""
Expand Down
Loading

0 comments on commit 958c0d4

Please sign in to comment.