Skip to content
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
45 changes: 37 additions & 8 deletions .ci/oci-devworkspace-happy-path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,22 @@ runHappyPathTest() {
return 1
fi

# Download and run the remote test script
if ! bash <(curl -s "https://raw.githubusercontent.com/eclipse/che/${CHE_REPO_BRANCH}/tests/devworkspace-happy-path/remote-launch.sh"); then
# Download the launcher to a file first: 'bash <(curl -s ...)' hides a fetch
# failure (set -e does not check process substitution exit codes, and an
# HTTP error body could be executed as a script).
# Return 2 on a download failure so that main() can tell it apart from a
# test failure: no test pod has run at that point, so classifying it from
# pod logs would wrongly report a TEST failure instead of INFRA.
local launcher="/tmp/che-remote-launch.sh"
if ! curl -fsSL "https://raw.githubusercontent.com/eclipse/che/${CHE_REPO_BRANCH}/tests/devworkspace-happy-path/remote-launch.sh" -o "${launcher}"; then
echo "ERROR: Failed to download remote-launch.sh from the che repository"
return 2
fi

# The remote test scripts wipe and recreate ARTIFACT_DIR when they start,
# which would delete the artifacts this job has already collected; give
# them a dedicated subdirectory instead.
if ! ARTIFACT_DIR="${ARTIFACT_DIR}/che-happy-path" bash "${launcher}"; then
echo "ERROR: Happy path test failed"

# Collect artifacts on test failure
Expand Down Expand Up @@ -343,7 +357,7 @@ classifyTestFailure() {
categorizeFailure() {
local reason="$1"
case "$reason" in
*"reconciliation"*|*"Image pull"*|*"OLM"*|*"operator timeout"*)
*"reconciliation"*|*"Image pull"*|*"OLM"*|*"operator timeout"*|*"Launcher download"*)
echo "INFRA"
;;
*"Dashboard"*|*"Workspace start"*|*"Authentication"*|*"Test execution"*)
Expand Down Expand Up @@ -403,7 +417,7 @@ generateReport() {
# Build Prow job link if available
local prow_link=""
if [ -n "${PROW_JOB_ID:-}" ]; then
prow_link="https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/devfile_devworkspace-operator/${PULL_NUMBER:-unknown}/pull-ci-devfile-devworkspace-operator-main-v14-che-happy-path/${BUILD_ID:-unknown}"
prow_link="https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/devfile_devworkspace-operator/${PULL_NUMBER:-unknown}/pull-ci-devfile-devworkspace-operator-main-v22-che-happy-path/${BUILD_ID:-unknown}"
Comment thread
artaleks9 marked this conversation as resolved.
Resolved
fi

# Write JSON report
Expand Down Expand Up @@ -515,15 +529,30 @@ main() {
fi

# Run the happy path test (with 1 retry)
if ! runHappyPathTest 1; then
# runHappyPathTest returns 2 when the launcher download failed: no test pod
# has run then, so classifying the failure from pod logs would wrongly
# report a TEST failure for what is a network/infrastructure issue.
runHappyPathTest 1
local test_rc=$?
Comment thread
artaleks9 marked this conversation as resolved.
Resolved
if [ "$test_rc" -ne 0 ]; then
local test_reason
test_reason=$(classifyTestFailure)
if [ "$test_rc" -eq 2 ]; then
test_reason="Launcher download failure"
else
test_reason=$(classifyTestFailure)
fi
recordAttempt "1/2" "runHappyPathTest" "FAILED" "$test_reason"

echo "⚠️ Happy path test failed on first attempt, retrying..."
sleep 30
if ! runHappyPathTest 2; then
test_reason=$(classifyTestFailure)
runHappyPathTest 2
test_rc=$?
if [ "$test_rc" -ne 0 ]; then
if [ "$test_rc" -eq 2 ]; then
test_reason="Launcher download failure"
else
test_reason=$(classifyTestFailure)
fi
recordAttempt "2/2" "runHappyPathTest" "FAILED" "$test_reason"
echo "❌ FAILED: Happy path test execution (2 attempts)"
return 1
Expand Down
2 changes: 1 addition & 1 deletion .ci/oci.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
# Temporary workaround since mirror.centos.org is down and can be replaced with vault.centos.org
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo

RUN yum install --assumeyes -d1 python3-pip gettext jq && \
RUN yum install --assumeyes -d1 python3-pip gettext jq unzip && \
pip3 install --upgrade pip && \
pip3 install --ignore-installed --upgrade setuptools && \
# Install yq and jq
pip3 install yq jq && \
# Install kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin && \
# Install chectl
bash <(curl -sL https://che-incubator.github.io/chectl/install.sh) --channel=next

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 5: pipCommand not pinned by hash
Click Remediation section below to solve this issue

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 5: pipCommand not pinned by hash
Click Remediation section below to solve this issue

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 5: pipCommand not pinned by hash
Click Remediation section below to solve this issue

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 5: downloadThenRun not pinned by hash
Click Remediation section below to solve this issue
Loading