Skip to content

Commit

Permalink
Unset BOSH_ALL_PROXY for the duration of the integration tests
Browse files Browse the repository at this point in the history
This value will be captured and re-exported after the test run.

If you attempt to run these tests, which mock out calls to the BOSH
director,  while BOSH_ALL_PROXY is set, the bosh cli will respect that
setting and try to use your targetted director, which is not ideal!
  • Loading branch information
selzoc committed Sep 6, 2024
1 parent 9b29e0d commit 42706b7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion bin/test-integration
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,17 @@ set -eu -o pipefail

ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"

echo -e "\n Running integration tests..."
if [ -n "${BOSH_ALL_PROXY:-}" ]; then
echo "BOSH_ALL_PROXY set, unsetting for integration test run"
temp_bosh_all_proxy="$BOSH_ALL_PROXY"
unset BOSH_ALL_PROXY
fi

echo -e "\nRunning integration tests..."
"${ROOT_DIR}/bin/ginkgo" -trace "${ROOT_DIR}/integration"

# Restore the value of BOSH_ALL_PROXY after the tests run
if [ -n "${temp_bosh_all_proxy:-}" ]; then
echo -e "\nBOSH_ALL_PROXY has been re-exported with the original value"
export BOSH_ALL_PROXY="${temp_bosh_all_proxy}"
fi

0 comments on commit 42706b7

Please sign in to comment.