Skip to content

Commit

Permalink
Ignore trailing slash for integration tests and increase wait timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Apr 13, 2024
1 parent 9a5b910 commit 12063e9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ jobs:
- run: docker build -f tests/integration/Dockerfile-basics tests/integration/
- run: docker run -d -p 8080:8080 -v "$PWD/composer.json":/app/composer.json $(docker images -q | head -n1)
- run: docker run -d --net=host -v "$PWD/tests/integration/":/home/framework-x/ -v "$PWD"/tests/integration/${{ matrix.config.path }}:/etc/nginx/conf.d/default.conf nginx:stable-alpine
- run: bash tests/await.bash http://localhost
- run: bash tests/integration.bash http://localhost
- run: bash tests/await.bash http://localhost/
- run: bash tests/integration.bash http://localhost/
- run: docker stop $(docker ps -qn2)
- run: docker logs $(docker ps -qn1)
if: ${{ always() }}
Expand Down Expand Up @@ -159,8 +159,8 @@ jobs:
- run: composer install -d tests/integration/
- run: docker run -d -v "$PWD/tests/integration/":/home/framework-x/ php:${{ matrix.php }}-fpm
- run: docker run -d -p 80:80 --link $(docker ps -qn1):php -v "$PWD/tests/integration/":/home/framework-x/ -v "$PWD"/tests/integration/nginx-fpm.conf:/etc/nginx/conf.d/default.conf nginx:stable-alpine
- run: bash tests/await.bash http://localhost
- run: bash tests/integration.bash http://localhost
- run: bash tests/await.bash http://localhost/
- run: bash tests/integration.bash http://localhost/
- run: docker logs $(docker ps -qn1)
if: ${{ always() }}

Expand All @@ -185,8 +185,8 @@ jobs:
php-version: ${{ matrix.php }}
- run: composer install -d tests/integration/
- run: docker run -d -p 80:80 -v "$PWD/tests/integration/":/home/framework-x/ php:${{ matrix.php }}-apache sh -c "rmdir /var/www/html;ln -s /home/framework-x/public /var/www/html;ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled; apache2-foreground"
- run: bash tests/await.bash http://localhost
- run: bash tests/integration.bash http://localhost
- run: bash tests/await.bash http://localhost/
- run: bash tests/integration.bash http://localhost/
- run: docker logs $(docker ps -qn1)
if: ${{ always() }}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ your installation like this:

```bash
$ php tests/integration/public/index.php
$ tests/integration.bash http://localhost:8080
$ tests/integration.bash http://localhost:8080/
```

## License
Expand Down
5 changes: 3 additions & 2 deletions tests/await.bash
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

base=${1:-http://localhost:8080}
base=${1:-http://localhost:8080/}
base=${base%/}

for i in {1..20}
for i in {1..600}
do
out=$(curl -v -X PROBE $base/ 2>&1) && exit 0 || echo -n .
sleep 0.1
Expand Down
3 changes: 2 additions & 1 deletion tests/integration.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

base=${1:-http://localhost:8080}
base=${1:-http://localhost:8080/}
base=${base%/}
baseWithPort=$(php -r 'echo parse_url($argv[1],PHP_URL_PORT) ? $argv[1] : $argv[1] . ":80";' "$base")

n=0
Expand Down

0 comments on commit 12063e9

Please sign in to comment.