Skip to content

Commit

Permalink
set -euo pipefail
Browse files Browse the repository at this point in the history
  • Loading branch information
mnot committed Mar 24, 2024
1 parent d0971fa commit 0000e57
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions test-browser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Run tests against a local browser on OSX.

set -euo pipefail

PORT=8000
DOWNLOADS=~/Downloads
PIDFILE=/tmp/http-cache-test-server.pid
Expand Down
12 changes: 6 additions & 6 deletions test-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Run tests against a local docker image with common proxy/caches.

set -euo pipefail

PIDFILE=/tmp/http-cache-test-server.pid

ALL_PROXIES=(squid nginx apache trafficserver varnish caddy nuster)
Expand All @@ -18,13 +20,11 @@ function usage {
}

function run {
TEST_ID="$1"
TEST_ID="${1}"
shift
PROXIES=( "$@" )
# start test server
npm run --silent server --port=8000 --pidfile=$PIDFILE &

echo $DOCKER_PORTS
npm run --silent server --port=8000 --pidfile=${PIDFILE} &

# run proxies container
docker run --platform linux/amd64 --name=tmp_proxies ${DOCKER_PORTS} -dt mnot/proxy-cache-tests host.docker.internal \
Expand Down Expand Up @@ -54,8 +54,8 @@ function cleanup {
docker rm tmp_nuster > /dev/null

# stop test server
kill "$(cat $PIDFILE)" > /dev/null 2>&1
rm $PIDFILE
kill "$(cat ${PIDFILE})" > /dev/null 2>&1
rm ${PIDFILE}
}

function test_proxy {
Expand Down
2 changes: 2 additions & 0 deletions test-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Run tests against a host/port combination.

set -euo pipefail

function usage {
if [[ -n "${1}" ]]; then
echo "${1}"
Expand Down

0 comments on commit 0000e57

Please sign in to comment.