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

Improve error display on failure #2696

Merged
merged 4 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ build-fprime-automatic*
/RPI/bin
/ci-venv/
/ci-logs*
/ci-Framework-logs*
TesterBase.*
GTestBase.*
**/DefaultDict/serializable/*
Expand Down
30 changes: 24 additions & 6 deletions ci/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,31 @@ function fail_and_stop()
echo -e "${RED}---------------- ERROR ----------------" 1>&2
echo "${1}" 1>&2
echo -e "---------------------------------------${NOCOLOR}" 1>&2
LASTLOG=$(ls -td $(find "${LOG_DIR}" -name "*err.log" -type f) | head -1)
if [ -f "${LASTLOG}" ]

# Look for an stderr log which is not empty
LASTLOG_ERR=$(ls -td $(find "${LOG_DIR}" -name "*err.log" -type f) | head -1)

if [ -f "${LASTLOG_ERR}" ]
then

echo -e "---------------- STDERR ---------------" 1>&2
tail -30 "${LASTLOG}" 1>&2
echo -e "---------------------------------------" 1>&2
# Check if a related stdout log exist
LASTLOG_OUT="${LASTLOG_ERR::-7}out.log" 1>&2
thomas-bc marked this conversation as resolved.
Show resolved Hide resolved

if [ -f "${LASTLOG_OUT}" ]
then
# Display stdout log
echo -e "${RED}---------------- STDOUT ---------------${NOCOLOR}" 1>&2
cat "${LASTLOG_OUT}" 1>&2
echo -e "${RED}---------------------------------------${NOCOLOR}" 1>&2
fi

# Display stderr log
echo -e "${RED}---------------- STDERR ---------------${NOCOLOR}" 1>&2
cat "${LASTLOG_ERR}" 1>&2
echo -e "${RED}---------------------------------------${NOCOLOR}" 1>&2

echo -e "${RED}---------------- END ERROR ------------" 1>&2
echo "${1}" 1>&2
echo -e "---------------------------------------${NOCOLOR}" 1>&2
fi
archive_logs
exit 1
Expand Down
Loading