Skip to content

Commit

Permalink
chore(setup): use rare port to prevent conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
pweyck committed Jul 19, 2024
1 parent cc623f8 commit 0c9516c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ jobs:
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test --repeat-each 4
run: |
echo $APP_URL
npx playwright test --repeat-each 4
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
9 changes: 3 additions & 6 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ x-service: &service
SHOPWARE_HTTP_CACHE_ENABLED: 0
DATABASE_URL: mysql://root:app@database:3306/install_test
APP_SECRET: secret
APP_URL: http://localhost:8000
APP_URL: http://localhost:8011
# TEST_WEB_INSTALLER: 1
# SHOPWARE_SKIP_WEBINSTALLER: 0
# SHOPWARE_DISABLE_UPDATE_CHECK: '0'
Expand All @@ -32,9 +32,6 @@ services:
"-c",
"docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --sql-require-primary-key=ON"
]

ports:
- '3306:3306'
tmpfs:
- /var/lib/mysql:uid=999,gid=999

Expand All @@ -43,15 +40,15 @@ services:
image: adminer:latest
depends_on: [ database ]
ports:
- '8080:8080'
- '8012:8080'

shopware:
<<: *service
# TODO: build trunk tag
image: ghcr.io/shopware/shopware/ci-e2e:trunk
depends_on: [ database ]
ports:
- '8000:8000'
- '8011:8000'
# mount platform
# volumes:
# - ../../:/var/www/html/custom/platform
Expand Down
7 changes: 4 additions & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { defineConfig, devices } from '@playwright/test';
process.env['SHOPWARE_ADMIN_USERNAME'] = process.env['SHOPWARE_ADMIN_USERNAME'] || 'admin';
process.env['SHOPWARE_ADMIN_PASSWORD'] = process.env['SHOPWARE_ADMIN_PASSWORD'] || 'shopware';

process.env['APP_URL'] = process.env['APP_URL'] ?? 'http://localhost:8000';
const defaultAppUrl = 'http://localhost:8011/';
process.env['APP_URL'] = process.env['APP_URL'] ?? defaultAppUrl;

// make sure APP_URL ends with a slash
process.env['APP_URL'] = (process.env['APP_URL'] ?? '').replace(/\/+$/, '') + '/';
Expand Down Expand Up @@ -31,10 +32,10 @@ export default defineConfig({
},
// We abuse this to wait for the external webserver
webServer: {
command: process.env['APP_URL'] === 'http://localhost:8000/' ? 'docker compose up --pull=always --quiet-pull shopware > /dev/null' : 'sleep 1h',
command: process.env['APP_URL'] === defaultAppUrl ? 'docker compose up --pull=always --quiet-pull shopware' : 'sleep 1h',
url: process.env['APP_URL'],
reuseExistingServer: true,
timeout: 120000,
timeout: 180000,
},
projects: [
{
Expand Down

0 comments on commit 0c9516c

Please sign in to comment.