Skip to content

Commit 5760427

Browse files
authored
Merge pull request #256 from clue-labs/integration
Clean up and improve structure of integration tests
2 parents 6ee8435 + 12063e9 commit 5760427

File tree

4 files changed

+482
-132
lines changed

4 files changed

+482
-132
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
php-version: ${{ matrix.php }}
8686
- run: composer install -d tests/integration/
8787
- run: php tests/integration/public/index.php &
88-
- run: bash tests/await.sh
88+
- run: bash tests/await.bash
8989
- run: bash tests/integration.bash
9090

9191
Docker:
@@ -104,7 +104,7 @@ jobs:
104104
- run: composer install -d tests/integration/
105105
- run: docker build -f tests/integration/${{ matrix.dockerfile }} tests/integration/
106106
- run: docker run -d -p 8080:8080 -v "$PWD/composer.json":/app/composer.json $(docker images -q | head -n1)
107-
- run: bash tests/await.sh
107+
- run: bash tests/await.bash
108108
- run: bash tests/integration.bash
109109
- run: docker stop $(docker ps -qn1)
110110
- run: docker logs $(docker ps -qn1)
@@ -129,8 +129,8 @@ jobs:
129129
- run: docker build -f tests/integration/Dockerfile-basics tests/integration/
130130
- run: docker run -d -p 8080:8080 -v "$PWD/composer.json":/app/composer.json $(docker images -q | head -n1)
131131
- 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
132-
- run: bash tests/await.sh http://localhost
133-
- run: bash tests/integration.bash http://localhost
132+
- run: bash tests/await.bash http://localhost/
133+
- run: bash tests/integration.bash http://localhost/
134134
- run: docker stop $(docker ps -qn2)
135135
- run: docker logs $(docker ps -qn1)
136136
if: ${{ always() }}
@@ -159,8 +159,8 @@ jobs:
159159
- run: composer install -d tests/integration/
160160
- run: docker run -d -v "$PWD/tests/integration/":/home/framework-x/ php:${{ matrix.php }}-fpm
161161
- 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
162-
- run: bash tests/await.sh http://localhost
163-
- run: bash tests/integration.bash http://localhost
162+
- run: bash tests/await.bash http://localhost/
163+
- run: bash tests/integration.bash http://localhost/
164164
- run: docker logs $(docker ps -qn1)
165165
if: ${{ always() }}
166166

@@ -185,8 +185,8 @@ jobs:
185185
php-version: ${{ matrix.php }}
186186
- run: composer install -d tests/integration/
187187
- 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"
188-
- run: bash tests/await.sh http://localhost
189-
- run: bash tests/integration.bash http://localhost
188+
- run: bash tests/await.bash http://localhost/
189+
- run: bash tests/integration.bash http://localhost/
190190
- run: docker logs $(docker ps -qn1)
191191
if: ${{ always() }}
192192

@@ -211,5 +211,5 @@ jobs:
211211
php-version: ${{ matrix.php }}
212212
- run: composer install -d tests/integration/
213213
- run: php -S localhost:8080 tests/integration/public/index.php &
214-
- run: bash tests/await.sh
214+
- run: bash tests/await.bash
215215
- run: bash tests/integration.bash

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ your installation like this:
136136

137137
```bash
138138
$ php tests/integration/public/index.php
139-
$ tests/integration.bash http://localhost:8080
139+
$ tests/integration.bash http://localhost:8080/
140140
```
141141

142142
## License

tests/await.sh renamed to tests/await.bash

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/bash
22

3-
base=${1:-http://localhost:8080}
3+
base=${1:-http://localhost:8080/}
4+
base=${base%/}
45

5-
for i in {1..20}
6+
for i in {1..600}
67
do
78
out=$(curl -v -X PROBE $base/ 2>&1) && exit 0 || echo -n .
89
sleep 0.1

0 commit comments

Comments
 (0)