Skip to content
Open
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
16 changes: 11 additions & 5 deletions dw-auto-validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ done

log() {
if [ ${VERBOSE} -eq 1 ]; then
echo ${@}
echo -e "$@"
fi
}

Expand Down Expand Up @@ -314,17 +314,23 @@ for devfile_url in "${DEVFILE_URL_LIST[@]}"; do
log -e "\n${GREEN}${DEVWORKSPACE_NAME} is Running${NC}"
else
log -e "\n${YELLOW}${DEVWORKSPACE_NAME} failed to start${NC}"
echo "TEST ${devfile_url} with ${image} FAILED ❌"
echo "TEST ${devfile_url} with ${image} FAILED ❌ (workspace state: ${state}, timed out after ${TIMEOUT}s)"
failed_test+=("Devfile '$devfile_url' using image '$image'")
continue
fi
log "Validating ${DEVWORKSPACE_NAME} .."
validate_devworkspace ${devfile_url}
if [ $? -eq 0 ]; then
result=$(validate_devworkspace ${devfile_url})
rc=$?
if [ ${rc} -eq 0 ]; then
echo "TEST ${devfile_url} with ${image} PASSED ✅"
((success_count++))
else
echo "TEST ${devfile_url} with ${image} FAILED ❌"
reason=$(echo "${result}" | grep '^ Reason:' | head -1)
if [ -n "${reason}" ]; then
echo "TEST ${devfile_url} with ${image} FAILED ❌ ${reason# Reason: }"
else
echo "TEST ${devfile_url} with ${image} FAILED ❌"
fi
failed_test+=("Devfile '$devfile_url' using image '$image'")
fi
sleep 1s
Expand Down
3 changes: 2 additions & 1 deletion settings/settings-jetbrains.env
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ validate_devworkspace() {
return 0
else
# fail
log $(oc exec -n ${DEVWORKSPACE_NS} ${podName} -c ${mainContainerName} -- cat /idea-server/std.out)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the point of log that all these message can be controlled (and silenced if wanted ?). With echo they are forcibly printed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree. the default mode is not intended to log too many.
if failures, the list of tests is displayed ( images/devfiles ) so you can tweak the accoring files, then re-run with -v that will verbose all the logs.

Copy link
Copy Markdown
Contributor Author

@adietish adietish May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're absolutely right. I oversaw that I completely skipped the ability to show/hide output with this patch. Reworking it. 🤦‍♂️

echo " Reason: landing page returned HTTP ${response} (expected 200)"
oc exec -n ${DEVWORKSPACE_NS} ${podName} -c ${mainContainerName} -- cat /idea-server/std.out
return 1
fi
}
4 changes: 2 additions & 2 deletions settings/settings-sshd.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ validate_devworkspace() {
oc exec -n ${DEVWORKSPACE_NS} ${podName} -c ${mainContainerName} -- cat /tmp/sshd.log &>/dev/null #always quiet this message an rely on return code
if [ $? -eq 1 ]; then
# fail to cat ssh log file
log "Failed to cat /tmp/sshd.log file on container"
echo " Reason: could not read /tmp/sshd.log from container"
return 1
fi
res=$(oc exec -n ${DEVWORKSPACE_NS} ${podName} -c ${mainContainerName} -- cat /tmp/sshd.log | grep -q 'Server listening on')
Expand All @@ -30,7 +30,7 @@ validate_devworkspace() {
return 0
else
# fail
log "Failed to retrieve sucessfull sshd status log in /tmp/sshd.log file on container"
echo " Reason: 'Server listening on' not found in /tmp/sshd.log"
return 1
fi
}
6 changes: 3 additions & 3 deletions settings/settings-vscode.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ validate_devworkspace() {
oc exec -n ${DEVWORKSPACE_NS} ${podName} -c ${mainContainerName} -- cat /checode/entrypoint-logs.txt &>/dev/null #always quiet this message an rely on return code
if [ $? -eq 1 ]; then
# fail to cat vscode log file
log "Failed to cat /checode/entrypoint-logs.txt file on container"
echo " Reason: could not read /checode/entrypoint-logs.txt from container"
return 1
fi
res=$(oc exec -n ${DEVWORKSPACE_NS} ${podName} -c ${mainContainerName} -- cat /checode/entrypoint-logs.txt | grep -q 'Extension host agent listening on 3100')
Expand All @@ -30,8 +30,8 @@ validate_devworkspace() {
return 0
else
# fail
log "Failed to retrieve sucessfull vscode status log in /checode/entrypoint-logs.txt file on container"
log $(oc exec -n ${DEVWORKSPACE_NS} ${podName} -c ${mainContainerName} -- cat /checode/entrypoint-logs.txt)
echo " Reason: 'Extension host agent listening on 3100' not found in /checode/entrypoint-logs.txt"
oc exec -n ${DEVWORKSPACE_NS} ${podName} -c ${mainContainerName} -- cat /checode/entrypoint-logs.txt
return 1
fi
}