Skip to content

Commit

Permalink
Fixing missing new lines, renaming as much of happy-path references a…
Browse files Browse the repository at this point in the history
…s possible

Signed-off-by: Tibor Dancs (tdancs-dogfooding) <[email protected]>
  • Loading branch information
ScrewTSW committed Jul 19, 2023
1 parent d51cff9 commit f29cf11
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
40 changes: 20 additions & 20 deletions .ci/oci-dashboard-happy-path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ SCRIPT_DIR=$(dirname $(readlink -f "$0"))

export WORKDIR=${WORKDIR:-"${SCRIPT_DIR}/workdir"}
export CHE_NAMESPACE=${CHE_NAMESPACE:-"eclipse-che"}
export HAPPY_PATH_POD_NAME='happy-path-che'
export HAPPY_PATH_POD_FILE="${SCRIPT_DIR}/resources/pod-che-smoke-test.yaml"
export ARTIFACT_DIR=${ARTIFACT_DIR:-"/tmp/devworkspace-happy-path-artifacts"}
export SMOKE_TEST_POD_NAME='smoke-test-che'
export SMOKE_TEST_POD_FILE="${SCRIPT_DIR}/resources/pod-che-smoke-test.yaml"
export ARTIFACT_DIR=${ARTIFACT_DIR:-"/tmp/devworkspace-smoke-test-artifacts"}

rm -rf ${WORKDIR}
mkdir -p ${WORKDIR}
Expand Down Expand Up @@ -120,33 +120,33 @@ function provisionOpenShiftOAuthUser() {
}

# method originally extracted from eclipse/che/tests/devworkspace-happy-path/launch.sh
startHappyPathTest() {
oc delete pod happy-path-che -n eclipse-che --grace-period=30 --ignore-not-found
# patch happy-path-che.yaml
startSmokeTest() {
oc delete pod "${SMOKE_TEST_POD_NAME}" -n eclipse-che --grace-period=30 --ignore-not-found
# patch smoke-test-che.yaml
ECLIPSE_CHE_URL=http://$(oc get route -n "${CHE_NAMESPACE}" che -o jsonpath='{.status.ingress[0].host}')
cp $HAPPY_PATH_POD_FILE ${WORKDIR}/e2e-pod.yaml
cp $SMOKE_TEST_POD_FILE ${WORKDIR}/e2e-pod.yaml
sed -i "s@CHE_URL@${ECLIPSE_CHE_URL}@g" ${WORKDIR}/e2e-pod.yaml
sed -i "s@CHE-NAMESPACE@${CHE_NAMESPACE}@g" ${WORKDIR}/e2e-pod.yaml
echo "[INFO] Applying the following patched Che Happy Path Pod:"
echo "[INFO] Applying the following patched Che Smoke Test Pod:"
cat ${WORKDIR}/e2e-pod.yaml
echo "[INFO] --------------------------------------------------"
oc apply -f ${WORKDIR}/e2e-pod.yaml
# wait for the pod to start
n=0
while [ $n -le 120 ]
do
PHASE=$(oc get pod -n ${CHE_NAMESPACE} ${HAPPY_PATH_POD_NAME} \
PHASE=$(oc get pod -n ${CHE_NAMESPACE} ${SMOKE_TEST_POD_NAME} \
--template='{{ .status.phase }}')
if [[ ${PHASE} == "Running" ]]; then
echo "[INFO] Happy-path test started successfully."
echo "[INFO] Smoke test started successfully."
return
fi

sleep 5
n=$(( n+1 ))
done

echo "[ERROR] Failed to start happy-path test."
echo "[ERROR] Failed to start smoke test."
exit 1
}

Expand Down Expand Up @@ -180,24 +180,24 @@ chectl server:deploy \
provisionOpenShiftOAuthUser

# Run Smoke test
startHappyPathTest
startSmokeTest

echo "[INFO] Waiting until happy path pod finished"
oc logs -n ${CHE_NAMESPACE} ${HAPPY_PATH_POD_NAME} -c happy-path-test -f
echo "[INFO] Waiting until smoke test pod finished"
oc logs -n ${CHE_NAMESPACE} ${SMOKE_TEST_POD_NAME} -c smoke-test -f
# just to sleep
sleep 3

# Download artifacts
echo "[INFO] Downloading test report."
oc rsync -n ${CHE_NAMESPACE} ${HAPPY_PATH_POD_NAME}:/tmp/e2e/report/ ${ARTIFACT_DIR}/e2e -c download-reports
oc exec -n ${CHE_NAMESPACE} ${HAPPY_PATH_POD_NAME} -c download-reports -- touch /tmp/done
EXIT_CODE=$(oc logs -n ${CHE_NAMESPACE} ${HAPPY_PATH_POD_NAME} -c happy-path-test | grep EXIT_CODE)
oc rsync -n ${CHE_NAMESPACE} ${SMOKE_TEST_POD_NAME}:/tmp/e2e/report/ ${ARTIFACT_DIR}/e2e -c download-reports
oc exec -n ${CHE_NAMESPACE} ${SMOKE_TEST_POD_NAME} -c download-reports -- touch /tmp/done
EXIT_CODE=$(oc logs -n ${CHE_NAMESPACE} ${SMOKE_TEST_POD_NAME} -c smoke-test | grep EXIT_CODE)
if [[ ${EXIT_CODE} != "+ EXIT_CODE=0" ]]; then
echo "[ERROR] Happy-path test failed. Check report at ${ARTIFACT_DIR}. Or happy path pod in eclipse-che namespace"
echo "[ERROR] Smoke test failed. Check report at ${ARTIFACT_DIR}. Or smoke test pod in eclipse-che namespace"
exit 1
fi
echo "[INFO] Happy-path test succeed."
echo "[INFO] Smoke test succeed."

# End test
END=$(date +%s.%N)
echo "[INFO] Happy-path execution took $(echo "$END - $START" | bc) seconds."
echo "[INFO] Smoke test execution took $(echo "$END - $START" | bc) seconds."
4 changes: 2 additions & 2 deletions .ci/oci-dashboard-puppeteer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ set -x
export CI_CHE_DASHBOARD_IMAGE=${CI_CHE_DASHBOARD_IMAGE:-quay.io/eclipse/che-dashboard:next}
export CHE_REPO_BRANCH="main"
export CHE_NAMESPACE="${CHE_NAMESPACE:-eclipse-che}"
export DEVWORKSPACE_HAPPY_PATH="https://raw.githubusercontent.com/eclipse/che/${CHE_REPO_BRANCH}/tests/devworkspace-happy-path"
export DEVWORKSPACE_SMOKE_TEST="https://raw.githubusercontent.com/eclipse/che/${CHE_REPO_BRANCH}/tests/devworkspace-happy-path"
export ECLIPSE_CHE_URL="${ECLIPSE_CHE_URL:-localhost}"
export KUBE_ADMIN_PASSWORD="${ECLIPSE_CHE_URL:-admin}"

source <(curl -s ${DEVWORKSPACE_HAPPY_PATH}/common.sh)
source <(curl -s ${DEVWORKSPACE_SMOKE_TEST}/common.sh)

#trap 'collectLogs $?' EXIT SIGINT

Expand Down
2 changes: 1 addition & 1 deletion .ci/resources/cluster-oauth-patch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
}
]
}
}
}
6 changes: 3 additions & 3 deletions .ci/resources/pod-che-smoke-test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Pod
metadata:
name: happy-path-che
name: smoke-test-che
namespace: CHE-NAMESPACE
spec:
volumes:
Expand All @@ -12,7 +12,7 @@ spec:
medium: Memory
containers:
# container containing the tests
- name: happy-path-test
- name: smoke-test
image: quay.io/eclipse/che-e2e:next
imagePullPolicy: Always
env:
Expand Down Expand Up @@ -78,4 +78,4 @@ spec:
"-c",
"while true; if [[ -f /tmp/done ]]; then exit 0; fi; do sleep 1; done",
]
restartPolicy: Never
restartPolicy: Never
2 changes: 1 addition & 1 deletion .ci/resources/users.htpasswd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
happypath-dev:$2y$05$W0AwRfPa1A1ne8QI0rvzpOgroeASayQdvNR.5GteVqjx26TOWz/km
happypath-dev:$2y$05$W0AwRfPa1A1ne8QI0rvzpOgroeASayQdvNR.5GteVqjx26TOWz/km

0 comments on commit f29cf11

Please sign in to comment.