Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ jobs:
timeout 30 bash -c 'until curl -s http://127.0.0.1:3000 > /dev/null 2>&1; do sleep 1; done' || echo "Playwright server ready or timeout"

- name: Tests
run: ./vendor/bin/pest --http-host=host.docker.internal --http-bind=0.0.0.0 --playwright-host=127.0.0.1 --playwright-port=3000
env:
PEST_SKIP_GEOLOCATION: true
run: ./vendor/bin/pest --parallel --http-host=host.docker.internal --http-bind=0.0.0.0 --playwright-host=127.0.0.1 --playwright-port=3000

- name: Stop Playwright container
if: always()
Expand Down Expand Up @@ -137,7 +139,7 @@ jobs:

- name: Run tests in Pest container
run: |
docker compose -f docker.test/docker-compose.yml run --rm pest -c "./vendor/bin/pest --http-bind=0.0.0.0 --http-host=pest --playwright-port=3000 --playwright-host=playwright"
docker compose -f docker.test/docker-compose.yml run --rm pest -c "./vendor/bin/pest --parallel --http-bind=0.0.0.0 --http-host=pest --playwright-port=3000 --playwright-host=playwright"

- name: Stop containers
if: always()
Expand Down
18 changes: 14 additions & 4 deletions docker.test/Dockerfile.pest
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS linux-headers && \
pecl install xdebug && \
docker-php-ext-enable xdebug && \
apk del .build-deps


# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# XDebug port
EXPOSE 9003
# Pest HTTP Server
EXPOSE 3080

VOLUME ["/app"]

WORKDIR /app

ENTRYPOINT ["/bin/sh"]
# Copy application code
COPY ./ /app

# Install composer dependencies
RUN composer update --prefer-stable --prefer-dist --no-interaction --no-progress --ansi --optimize-autoloader

# Set proper permissions for the /app directory to allow user 1000 to write
RUN chown -R 1000:1000 /app

CMD ["tail", "-f", "/dev/null"]
12 changes: 6 additions & 6 deletions docker.test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ services:
- "127.0.0.1:3000:3000"
extra_hosts:
- "host.docker.internal:host-gateway"

pest:
hostname: pest
build:
context: ./
dockerfile: Dockerfile.pest
context: ../
dockerfile: docker.test/Dockerfile.pest
user: "1000:1000"
volumes:
- type: bind
source: ./../
target: /app
ports:
- "127.0.0.1:3080:3080"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- PEST_SKIP_GEOLOCATION=true
depends_on:
- playwright

networks:
default:
ipam:
Expand Down
2 changes: 1 addition & 1 deletion docker.test/playwright.entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh
npx playwright --version
npx -y playwright run-server --port 3000 --host 0.0.0.0
npx playwright run-server --host 0.0.0.0 --port 3000 --mode launchServer
2 changes: 1 addition & 1 deletion tests/Browser/Visit/FromTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
->assertSeeIn('#longitude', (string) $city->geolocation()['longitude'])
->assertDontSee('Waiting...');
}
});
})->skip(fn () => getenv('PEST_SKIP_GEOLOCATION') === 'true', 'Geolocation requires secure origin');
2 changes: 1 addition & 1 deletion tests/Browser/Visit/GeolocationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
->assertSeeIn('#latitude', (string) $latitude)
->assertSeeIn('#longitude', (string) $longitude)
->assertDontSee('Waiting...');
});
})->skip(fn () => getenv('PEST_SKIP_GEOLOCATION') === 'true', 'Geolocation requires secure origin');
Loading