mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Tests: Make assertCapturedSuccess check stderr is empty again (#1087)
`assertCapturedSuccess` used to check that `stderr` was empty, until: https://github.com/heroku/heroku-buildpack-python/commit/797652a75d69a1fece96a26bf4514fe9e9e1c020#diff-65c067a6f0a3aef292fb54ec21a1fe8cR98 Adding back the assertion exposes some new bugs, which I'll fix in later PRs. In the meantime affected tests have been adjusted to use a new `assertCapturedSuccessWithStdErr`. The test harness output for the failing case has also been improved, to ease debugging. Closes @W-7918492@. [skip changelog]
This commit is contained in:
+21
-8
@@ -85,12 +85,20 @@ assertNotCaptured()
|
||||
assertCapturedSuccess()
|
||||
{
|
||||
assertEquals "Captured exit code -" "0" "${RETURN}"
|
||||
# assertEquals "STD_ERR -" "" "$(cat ${STD_ERR})"
|
||||
assertEquals "STD_ERR -" "" "$(cat ${STD_ERR})"
|
||||
|
||||
if [ $RETURN -ne 0 -a -z "$(cat ${STD_ERR})" ]; then
|
||||
# Failing exit code but stderr was empty. Display stdout to help debugging.
|
||||
cat $STD_OUT
|
||||
echo
|
||||
if [ $RETURN -ne 0 -o -n "$(cat ${STD_ERR})" ]; then
|
||||
debug
|
||||
fi
|
||||
}
|
||||
|
||||
assertCapturedSuccessWithStdErr()
|
||||
{
|
||||
assertEquals "Captured exit code -" "0" "${RETURN}"
|
||||
assertNotEquals "STD_ERR -" "" "$(cat ${STD_ERR})"
|
||||
|
||||
if [ ${RETURN} -ne 0 ]; then
|
||||
debug
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -151,9 +159,14 @@ _assertContains()
|
||||
|
||||
debug()
|
||||
{
|
||||
cat $STD_OUT
|
||||
echo '^^^^^^'
|
||||
cat $STD_ERR
|
||||
echo
|
||||
echo '### STD_OUT ###'
|
||||
cat "${STD_OUT}"
|
||||
echo
|
||||
echo '### STD_ERR ###'
|
||||
cat "${STD_ERR}"
|
||||
echo
|
||||
echo
|
||||
}
|
||||
|
||||
assertContains()
|
||||
|
||||
Reference in New Issue
Block a user