Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix e2e tests #989

Merged
merged 5 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .ci/oci-devworkspace-happy-path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,14 @@ EOL

cat /tmp/che-cr-patch.yaml

chectl server:deploy --che-operator-cr-patch-yaml=/tmp/che-cr-patch.yaml -p openshift --templates=${TEMPLATES} --batch --telemetry=off --installer=operator --che-operator-image=${OPERATOR_IMAGE}
chectl server:deploy \
--batch \
--che-operator-cr-patch-yaml=/tmp/che-cr-patch.yaml \
--platform openshift \
--templates=${TEMPLATES} \
--telemetry=off \
--installer=operator \
--che-operator-image=${OPERATOR_IMAGE}
}

startHappyPathTest() {
Expand Down
9 changes: 8 additions & 1 deletion .ci/oci-disconnected.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@ initDefaults
provisionOpenShiftOAuthUser

# Deploy Eclipse Che and retrieve golang devfile from devfile-registry
chectl server:deploy --telemetry=off --k8spodwaittimeout=1800000 --che-operator-cr-patch-yaml=/tmp/che-cr-patch.yaml --che-operator-image=${INTERNAL_REGISTRY_URL}/eclipse/che-operator:next --platform=openshift --installer=operator
chectl server:deploy \
--batch \
--telemetry=off \
--k8spodwaittimeout=1800000 \
--che-operator-cr-patch-yaml=/tmp/che-cr-patch.yaml \
--che-operator-image=${INTERNAL_REGISTRY_URL}/eclipse/che-operator:next \
--platform=openshift \
--installer=operator

DEVFILEURL=$(oc get checluster/eclipse-che -n eclipse-che -o "jsonpath={.status.devfileRegistryURL}")
curl -sSLo- -vk "${DEVFILEURL}/devfiles/go/devfile.yaml" > /tmp/devfile.yaml
Expand Down
2 changes: 1 addition & 1 deletion .ci/oci-nightly-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ runTests() {
createWorkspace

# Update Eclipse Che to next and start workspace
chectl server:update --yes --templates="${TEMPLATES}" --che-operator-image=${OPERATOR_IMAGE}
chectl server:update --batch --templates="${TEMPLATES}" --che-operator-image=${OPERATOR_IMAGE}
waitEclipseCheDeployed "next"
startExistedWorkspace
waitWorkspaceStart
Expand Down
19 changes: 15 additions & 4 deletions .github/bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ catchFinish() {
initDefaults() {
export RAM_MEMORY=8192
export NAMESPACE="eclipse-che"
export USER_NAMEPSACE="che-che"
export USER_NAMEPSACE="admin-che"
export ARTIFACTS_DIR=${ARTIFACT_DIR:-"/tmp/artifacts-che"}
export TEMPLATES=${OPERATOR_REPO}/tmp
export OPERATOR_IMAGE="test/che-operator:test"
Expand Down Expand Up @@ -97,7 +97,7 @@ initStableTemplates() {
if [ "${compareResult}" == "-1" ]; then
cp -rf ${lastOperatorPath}/deploy/* "${LAST_OPERATOR_TEMPLATE}/che-operator"
else
prepareTemplates "${lastOperatorPath}" "${LAST_OPERATOR_TEMPLATE}/che-operator"
prepareTemplates "${lastOperatorPath}" "${LAST_OPERATOR_TEMPLATE}/che-operator"
fi
}

Expand Down Expand Up @@ -226,6 +226,7 @@ deployEclipseCheStable(){
local version=$3

chectl server:deploy \
--batch \
--platform=${platform} \
--installer ${installer} \
--chenamespace ${NAMESPACE} \
Expand Down Expand Up @@ -286,7 +287,11 @@ updateEclipseChe() {
local image=$1
local templates=$2

chectl server:update --chenamespace=${NAMESPACE} -y --che-operator-image=${image} --templates=${templates}
chectl server:update \
--batch \
--chenamespace=${NAMESPACE} \
--che-operator-image=${image} \
--templates=${templates}
}

# Create and start a workspace
Expand Down Expand Up @@ -454,7 +459,13 @@ spec:
nonProxyHosts: oauth-openshift.apps.$DOMAIN
EOL

chectl server:deploy --installer=operator --platform=openshift --batch --templates=${TEMPLATES} --che-operator-cr-patch-yaml=/tmp/che-cr-patch.yaml --che-operator-image ${OPERATOR_IMAGE}
chectl server:deploy \
--batch \
--installer=operator \
--platform=openshift \
--templates=${TEMPLATES} \
--che-operator-cr-patch-yaml=/tmp/che-cr-patch.yaml \
--che-operator-image ${OPERATOR_IMAGE}
oc get checluster eclipse-che -n eclipse-che -o yaml
}

Expand Down
14 changes: 2 additions & 12 deletions .github/bin/minikube/test-olm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,16 @@ runTest() {
startNewWorkspace
waitWorkspaceStart

# stop workspace to free some resources
# stop workspace to clean up resources
stopExistedWorkspace
waitExistedWorkspaceStop
kubectl delete namespace ${USER_NAMEPSACE}

deployCertManager

# Dev Workspace controller tests
enableDevWorkspaceEngine
waitDevWorkspaceControllerStarted

sleep 10s
createWorkspaceDevWorkspaceController
waitAllPodsRunning ${DEVWORKSPACE_CONTROLLER_TEST_NAMESPACE}
kubectl delete namespace ${DEVWORKSPACE_CONTROLLER_TEST_NAMESPACE}

sleep 60s

createWorkspaceDevWorkspaceCheOperator
waitAllPodsRunning ${DEVWORKSPACE_CHE_OPERATOR_TEST_NAMESPACE}
kubectl delete namespace ${DEVWORKSPACE_CHE_OPERATOR_TEST_NAMESPACE}
}

initDefaults
Expand Down
14 changes: 2 additions & 12 deletions .github/bin/minikube/test-operator-singlehost-gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,16 @@ runTest() {
startNewWorkspace
waitWorkspaceStart

# stop workspace to free some resources
# stop workspace to clean up resources
stopExistedWorkspace
waitExistedWorkspaceStop
kubectl delete namespace ${USER_NAMEPSACE}

deployCertManager

# Dev Workspace controller tests
enableDevWorkspaceEngine
waitDevWorkspaceControllerStarted

sleep 10s
createWorkspaceDevWorkspaceController
waitAllPodsRunning ${DEVWORKSPACE_CONTROLLER_TEST_NAMESPACE}
kubectl delete namespace ${DEVWORKSPACE_CONTROLLER_TEST_NAMESPACE}

sleep 60s

createWorkspaceDevWorkspaceCheOperator
waitAllPodsRunning ${DEVWORKSPACE_CHE_OPERATOR_TEST_NAMESPACE}
kubectl delete namespace ${DEVWORKSPACE_CHE_OPERATOR_TEST_NAMESPACE}
}

initDefaults
Expand Down
14 changes: 2 additions & 12 deletions .github/bin/minikube/test-operator-singlehost-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,16 @@ runTest() {
startNewWorkspace
waitWorkspaceStart

# stop workspace to free some resources
# stop workspace to clean up resources
stopExistedWorkspace
waitExistedWorkspaceStop
kubectl delete namespace ${USER_NAMEPSACE}

deployCertManager

# Dev Workspace controller tests
enableDevWorkspaceEngine
waitDevWorkspaceControllerStarted

sleep 10s
createWorkspaceDevWorkspaceController
waitAllPodsRunning ${DEVWORKSPACE_CONTROLLER_TEST_NAMESPACE}
kubectl delete namespace ${DEVWORKSPACE_CONTROLLER_TEST_NAMESPACE}

sleep 60s

createWorkspaceDevWorkspaceCheOperator
waitAllPodsRunning ${DEVWORKSPACE_CHE_OPERATOR_TEST_NAMESPACE}
kubectl delete namespace ${DEVWORKSPACE_CHE_OPERATOR_TEST_NAMESPACE}
}

initDefaults
Expand Down
7 changes: 5 additions & 2 deletions .github/bin/minishift/test-stable-operator-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ EOF
}

runTest() {
chectl server:deploy --platform minishift --installer operator \
chectl server:deploy \
--batch \
--platform minishift \
--installer operator \
--version ${PREVIOUS_PACKAGE_VERSION} \
--che-operator-cr-patch-yaml ${OPERATOR_REPO}/tmp/patch.yaml

createWorkspace

chectl server:update --version ${LAST_PACKAGE_VERSION} -y
chectl server:update --batch --templates=$LAST_OPERATOR_TEMPLATE
waitEclipseCheDeployed ${LAST_PACKAGE_VERSION}

startExistedWorkspace
Expand Down