chore: add logs to e2e procedure
This commit is contained in:
parent
2c53306f5a
commit
5ed9bd243f
2 changed files with 13 additions and 2 deletions
4
.github/workflows/common-e2e.yml
vendored
4
.github/workflows/common-e2e.yml
vendored
|
@ -78,7 +78,7 @@ jobs:
|
|||
docker network connect --alias cache e2e-network cache
|
||||
|
||||
- name: Run Server
|
||||
run: docker run --network e2e-network -d -p 3123:3000 standardnotes/server:${{ github.sha }}
|
||||
run: docker run -v $(pwd)/logs:/var/lib/server/logs --network e2e-network -d -p 3123:3000 standardnotes/server:${{ github.sha }}
|
||||
env:
|
||||
EXPOSED_PORT: 3123
|
||||
EXPOSED_FILES_SERVER_PORT: 3125
|
||||
|
@ -101,7 +101,7 @@ jobs:
|
|||
API_GATEWAY_LOG_LEVEL: debug
|
||||
|
||||
- name: Wait for server to start
|
||||
run: docker/is-available.sh http://localhost:3123
|
||||
run: docker/is-available.sh http://localhost:3123 $(pwd)/logs
|
||||
|
||||
- name: Run E2E Test Suite
|
||||
run: yarn dlx mocha-headless-chrome --timeout 1200000 -f http://localhost:9001/mocha/test.html
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
WAIT_FOR_URL="$1"
|
||||
shift
|
||||
LOGS_PATH="$1"
|
||||
shift
|
||||
|
||||
attempt=0
|
||||
while [ $attempt -le 180 ]; do
|
||||
|
@ -11,7 +13,16 @@ while [ $attempt -le 180 ]; do
|
|||
if [ "$?" -eq "0" ]; then
|
||||
sleep 2 # for warmup
|
||||
echo "# All services are up!"
|
||||
exit 0
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "# Failed to wait for all services to be up!"
|
||||
|
||||
echo "# Errors:"
|
||||
tail $LOGS_PATH/*.err
|
||||
|
||||
echo "# Logs:"
|
||||
tail $LOGS_PATH/*.log
|
||||
|
|
Loading…
Reference in a new issue