Skip to content

Commit

Permalink
Merge pull request #33 from startersclan/docs/enhance-full-bf2-stack-…
Browse files Browse the repository at this point in the history
…example-with-improved-instructions-custom-gameserver-configs-and-a-custom-asp-config

Enhancement (ci): Add integration test
  • Loading branch information
leojonathanoh authored Oct 3, 2022
2 parents 5c46ea1 + fe03946 commit e4b0d0b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/ci-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@ on:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test (integration)
run: |
set -eu
docker-compose up --build -d
docker-compose -f docker-compose.test.yml up
build:
runs-on: ubuntu-latest
Expand Down
34 changes: 33 additions & 1 deletion docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,29 @@ services:
http://asp-nginx/ASP/ 200
http://asp-nginx/ASP/aspx 401
http://asp-nginx/ASP/bf2statistics.php 403
http://asp-nginx/ASP/frontend 401
http://asp-nginx/ASP/frontend/css/bootstrap.min.css 200
http://asp-nginx/ASP/frontend/images/maps/foo.png 200
http://asp-nginx/ASP/frontend/images/ranks/foo.png 200
http://asp-nginx/ASP/frontend/images/armies/foo.png 200
http://asp-nginx/ASP/frontend/css/bootstrap.min.css 200
http://asp-nginx/ASP/frontend 401
http://asp-nginx/ASP/createplayer.aspx 200
http://asp-nginx/ASP/getawardsinfo.aspx 200
http://asp-nginx/ASP/getbackendinfo.aspx 200
http://asp-nginx/ASP/getleaderboard.aspx 200
http://asp-nginx/ASP/getmapinfo.aspx 200
http://asp-nginx/ASP/getplayerid.aspx 200
http://asp-nginx/ASP/getplayerinfo.aspx 200
http://asp-nginx/ASP/getrankinfo.aspx 200
http://asp-nginx/ASP/getunlocksinfo.aspx 200
http://asp-nginx/ASP/ranknotification.aspx 200
http://asp-nginx/ASP/searchforplayers.aspx 200
http://asp-nginx/ASP/selectunlock.aspx 200
http://asp-nginx/ASP/verifyplayer.aspx 200
http://asp-nginx/ASP/index.php 200
http://asp-nginx/ASP/ranknotification.aspx 200
http://asp-nginx/ASP/searchforplayers.aspx 200
http://asp-nginx/ASP/selectunlock.aspx 200
http://asp-nginx/ASP/getplayerinfo.aspx 200
http://asp-nginx/ASP/system 401
networks:
Expand All @@ -26,6 +42,22 @@ services:
- -c
- |
set -eu
echo "Waiting for stack to be ready"
s=0
while true; do
nc -vz -w 1 asp-nginx 80 \
&& nc -vz -w 1 asp-php 9000 \
&& nc -vz -w 1 db 3306 \
&& break || true
s=$$(( $$s + 1 ))
if [ "$$s" -eq 600 ]; then
exit 1
fi
echo "Retrying in 3 seconds"
sleep 3
done
echo "$$URLS" | awk NF | while read -r i j; do
if wget -q -SO- "$$i" 2>&1 | grep "HTTP/1.1 $$j " > /dev/null; then
echo "PASS: $$i"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ services:
asp-php:
build:
dockerfile: Dockerfile.php.dev
context: .
volumes:
- ./src:/src
- ./config/ASP/config.php:/src/ASP/system/config/config.php # Main config file. Must be writeable or else ASP will throw an exception. Customize as needed
Expand Down

0 comments on commit e4b0d0b

Please sign in to comment.