Skip to content

Commit

Permalink
Add output error log to user for create_experiment.py on fail in CI (#…
Browse files Browse the repository at this point in the history
…1974)

Small changes to driver CI bash scripts to recapture error log from `create_experment.py` logger
Fixes #1939
  • Loading branch information
TerrenceMcGuinness-NOAA authored Oct 31, 2023
1 parent b2e4a2e commit 872068c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ci/scripts/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ for pr in ${pr_list}; do
export pslot="${case}_${pr_sha}"
rm -Rf "${STMP}/RUNDIRS/${pslot}"
set +e
export LOGFILE_PATH="${HOMEgfs}/ci/scripts/create_experiment.log"
"${HOMEgfs}/workflow/create_experiment.py" --yaml "${HOMEgfs}/ci/cases/pr/${case}.yaml"
ci_status=$?
set -e
Expand All @@ -169,7 +170,7 @@ for pr in ${pr_list}; do
echo "Failed to create experiment: *FAIL* ${pslot}"
echo "Experiment setup: failed at $(date) for experiment ${pslot}" || true
echo ""
cat "${HOMEgfs}/ci/scripts/"setup_*.std*
cat "${LOGFILE_PATH}"
} >> "${GFS_CI_ROOT}/PR/${pr}/output_${id}"
"${GH}" pr edit "${pr}" --repo "${REPO_URL}" --remove-label "CI-${MACHINE_ID^}-Building" --add-label "CI-${MACHINE_ID^}-Failed"
"${ROOT_DIR}/ci/scripts/pr_list_database.py" --remove_pr "${pr}" --dbfile "${pr_list_dbfile}"
Expand Down
2 changes: 1 addition & 1 deletion workflow/create_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
_top = os.path.abspath(os.path.join(os.path.abspath(_here), '..'))

# Setup the logger
logger = Logger(level=os.environ.get("LOGGING_LEVEL", "INFO"), colored_log=True)
logger = Logger(logfile_path=os.environ.get("LOGFILE_PATH"), level=os.environ.get("LOGGING_LEVEL", "DEBUG"), colored_log=True)


@logit(logger)
Expand Down

0 comments on commit 872068c

Please sign in to comment.