File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464
6565 - name : Docker Setup Buildx
6666 uses : docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
67+ with :
68+ # docker-container driver isolates the mock-server build and flakes
69+ # when many matrix jobs hit Packagist/GitHub at once.
70+ driver : docker
6771
6872 - name : Setup PHP with PECL extension
6973 uses : shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
Original file line number Diff line number Diff line change 1- FROM composer:2.10 as composer
1+ FROM composer:2.10 AS composer
22
33LABEL maintainer="team@appwrite.io"
44
@@ -10,11 +10,19 @@ WORKDIR /usr/local/src/
1010COPY composer.lock /usr/local/src/
1111COPY composer.json /usr/local/src/
1212
13- RUN composer install --ignore-platform-reqs --optimize-autoloader \
14- --no-plugins --no-scripts --prefer-dist \
15- `if [ "$TESTING" != "true" ]; then echo "--no-dev" ; fi`
16-
17- FROM phpswoole/swoole:5.1.8-php8.3-alpine as final
13+ RUN set -eu; \
14+ extra="" ; \
15+ if [ "${TESTING}" != "true" ]; then extra="--no-dev" ; fi; \
16+ n=0; \
17+ until composer install --ignore-platform-reqs --optimize-autoloader \
18+ --no-plugins --no-scripts --prefer-dist --no-interaction ${extra}; do \
19+ n=$((n + 1)); \
20+ if [ "${n}" -ge 5 ]; then exit 1; fi; \
21+ echo "composer install failed, retrying ${n}/5..." ; \
22+ sleep $((n * 5)); \
23+ done
24+
25+ FROM phpswoole/swoole:5.1.8-php8.3-alpine AS final
1826
1927RUN apk add docker
2028
Original file line number Diff line number Diff line change 2626 },
2727 "require-dev": {
2828 "phpunit/phpunit": "^12",
29- "mockery/mockery": "1.6.13 "
29+ "mockery/mockery": "1.6.14 "
3030 },
3131 "prefer-stable": true,
3232 "minimum-stability": "dev"
Original file line number Diff line number Diff line change 55namespace Tests \E2E ;
66
77use Exception ;
8+ use Override ;
89use RecursiveIteratorIterator ;
910use RecursiveDirectoryIterator ;
1011use FilesystemIterator ;
@@ -423,22 +424,33 @@ abstract class Base extends TestCase
423424 protected string $ sdkLanguage ;
424425 protected string $ version ;
425426
427+ #[Override]
426428 public function setUp (): void
427429 {
428430 \array_unshift ($ this ->expectedOutput , $ this ->getExpectedSdkHeaders ());
429431
430- \exec ('
431- cd ./mock-server && \
432- docker compose build && \
433- docker compose up -d --force-recreate
434- ' );
432+ $ output = [];
433+ $ status = 0 ;
434+
435+ \exec (
436+ 'cd ./mock-server && docker compose build && docker compose up -d --force-recreate 2>&1 ' ,
437+ $ output ,
438+ $ status
439+ );
440+
441+ if ($ status !== 0 ) {
442+ $ this ->fail (
443+ "Failed to start mock-server (exit {$ status }): \n" . \implode ("\n" , $ output )
444+ );
445+ }
435446 }
436447
437448 protected function getExpectedSdkHeaders (): string
438449 {
439450 return "x-sdk-name: {$ this ->sdkName }; x-sdk-platform: {$ this ->sdkPlatform }; x-sdk-language: {$ this ->sdkLanguage }; x-sdk-version: {$ this ->version }" ;
440451 }
441452
453+ #[Override]
442454 public function tearDown (): void
443455 {
444456 // Remove the mock server so local test runs don't leave containers behind
You can’t perform that action at this time.
0 commit comments