Skip to content

Commit

Permalink
[Tests] ignore travis-ci env vars; improve debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 26, 2024
1 parent 80cb39d commit 4c7d899
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cleanup () { rm -f "${BEFORE}" "${AFTER}"; }
die () { echo "$@" ; cleanup ; exit 1; }

typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${BEFORE}"
env | grep -v PATH= | grep -v IFS= | grep -v NVM_ | sort >> "${BEFORE}"
env | grep -v PATH= | grep -v IFS= | grep -v NVM_ | grep -v TRAVIS_ | sort >> "${BEFORE}"

set +e # TODO: fix
\. ../../nvm.sh
Expand All @@ -20,11 +20,11 @@ type nvm > /dev/null 2>&1 || die "nvm not loaded"
nvm unload

typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${AFTER}"
env | grep -v PATH= | grep -v IFS= | sort >> "${AFTER}"
env | grep -v PATH= | grep -v IFS= | grep -v TRAVIS_ | sort >> "${AFTER}"

! type nvm > /dev/null 2>&1 || die "nvm not unloaded"

DIFF="$(diff "${BEFORE}" "${AFTER}" ||:)"
[ -z "${DIFF}" ] || die "function pollution found: ${DIFF}"
[ -z "${DIFF}" ] || die "function pollution found: >${DIFF}<"

cleanup

0 comments on commit 4c7d899

Please sign in to comment.