Skip to content

Commit

Permalink
runtest: allow overrideable post-processing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
tlvu committed Oct 31, 2024
1 parent c9c8d50 commit 7fce738
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions downloadrepos
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ choose_artifact_filename() {
}


# Any post-processing steps at the end of runtest.
#
# Override this function in CONFIG_OVERRIDE_SCRIPT_URL to add extra steps,
# see demo in test-override/jenkins-params-external-repos.include.sh.
#
post_runtest() {
# Can not have empty function, have to put something here.
echo "Default: no post_runtest() override."
}


if [ -z "$DOWNLOADREPOS_AS_LIB" ]; then
# Script mode, not library mode.
downloadrepos_main "$@"
Expand Down
5 changes: 5 additions & 0 deletions runtest
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,10 @@ for nb in $NOTEBOOKS; do
fi
done


# Post-processing steps override in CONFIG_OVERRIDE_SCRIPT_URL.
post_runtest


# exit with return code from py.test
exit $EXIT_CODE
8 changes: 8 additions & 0 deletions test-override/jenkins-params-external-repos.include.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@ NOTEBOOKS="$ROOK_DIR/notebooks/*.ipynb"
choose_artifact_filename() {
echo "$1"
}
# Sample demo override post_runtest: create lots of artifacts for Jenkins to
# archive to test how Jenkins will display its archive page.
post_runtest() {
for i in $(seq --equal-width 500); do
echo "file${i}" > "${BUILDOUT_DIR}/file${i}.ipynb"
done
}
' > "$CONFIG_OVERRIDE_SCRIPT_URL"

0 comments on commit 7fce738

Please sign in to comment.