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
10 changes: 7 additions & 3 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
###> symfony/framework-bundle ###
APP_ENV=test
APP_SECRET='$ecretf0rt3st'
###< symfony/framework-bundle ###

# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
Expand All @@ -11,9 +15,9 @@ PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
DATABASE_HOST=postgres
DATABASE_PORT=5432
DATABASE_NAME=larpilot
DATABASE_USER=postgres
DATABASE_USER=larpilot
DATABASE_PASSWORD=password
DATABASE_SERVER_VERSION=13
DATABASE_SERVER_VERSION=15

# Messenger & Mailer (test stubs)
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
Expand Down
70 changes: 0 additions & 70 deletions .github/workflows/phpunit.yml

This file was deleted.

78 changes: 18 additions & 60 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ jobs:
postgres:
image: postgres:15
env:
POSTGRES_USER: larpilot_test
POSTGRES_PASSWORD: larpilot_test
POSTGRES_DB: larpilot_test
POSTGRES_USER: larpilot
POSTGRES_PASSWORD: password
POSTGRES_DB: larpilot
options: >-
--health-cmd pg_isready
--health-interval 10s
Expand Down Expand Up @@ -94,75 +94,37 @@ jobs:

- name: Setup test environment
run: |
cp .env .env.test.local || true
echo "APP_ENV=test" >> .env.test.local
echo "DATABASE_URL=postgresql://larpilot_test:larpilot_test@127.0.0.1:5432/larpilot_test?serverVersion=15&charset=utf8" >> .env.test.local
# Create .env.test.local to override .env.test values for GitHub Actions
echo "DATABASE_HOST=127.0.0.1" > .env.test.local

- name: Create test database
env:
DATABASE_HOST: 127.0.0.1
run: |
php bin/console doctrine:database:create --env=test --if-not-exists
php bin/console doctrine:migrations:migrate --env=test --no-interaction

- name: Build assets (SASS)
env:
DATABASE_HOST: 127.0.0.1
run: |
php bin/console sass:build --env=test
php bin/console asset-map:compile --env=test

- name: Build Codeception Actors
run: vendor/bin/codecept build

- name: Run All Codeception Tests
- name: Run Codeception Tests
env:
DATABASE_HOST: 127.0.0.1
run: |
APP_ENV=test vendor/bin/codecept run --colors

- name: Run Unit Tests Only
run: |
APP_ENV=test vendor/bin/codecept run unit --colors

- name: Run Functional Tests Only
run: |
APP_ENV=test vendor/bin/codecept run functional --colors

docker-tests:
name: Docker Environment Tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Copy .env file
run: cp .env .env.local || true

- name: Build Docker containers
run: docker compose build

- name: Start Docker containers
run: docker compose up -d

- name: Wait for services to be ready
run: |
sleep 30
docker compose ps

- name: Install dependencies in container
run: docker compose exec -T php composer install --no-interaction

- name: Run migrations in container
run: |
docker compose exec -T php php bin/console doctrine:database:create --env=test --if-not-exists
docker compose exec -T php php bin/console doctrine:migrations:migrate --env=test --no-interaction

- name: Build Codeception Actors in container
run: docker compose exec -T php vendor/bin/codecept build

- name: Run Codeception tests in Docker container
run: |
docker compose exec -T php bash -lc "APP_ENV=test vendor/bin/codecept run --colors"

- name: Stop Docker containers
if: always()
run: docker compose down

summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [code-quality, tests, docker-tests]
needs: [code-quality, tests]
if: always()

steps:
Expand All @@ -176,8 +138,4 @@ jobs:
echo "Codeception tests failed"
exit 1
fi
if [ "${{ needs.docker-tests.result }}" != "success" ]; then
echo "Docker tests failed"
exit 1
fi
echo "All tests passed successfully!"
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
/vendor/
###< symfony/framework-bundle ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

###> symfony/asset-mapper ###
/public/assets/
/public/uploads/maps/*
Expand Down
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
- JavaScript is written as ES6 modules and organized under `assets/controllers/` using Stimulus. Use 4 space indentation and define `targets`, `values`, and life‑cycle methods (e.g., `connect`). Webpack Encore bundles assets and the entry point is `assets/app.js`.

## Tests and checks
- Run unit tests with `vendor/bin/phpunit -c phpunit.xml.dist`.
- Run code style checks with `vendor/bin/ecs check`.
- Run static analysis with `vendor/bin/phpstan analyse -c phpstan.neon`.
- Prepare tests with `make test-build`.
- Run unit tests with `make test`.
- Run code style checks with `make ecs-fix`.
- Run static analysis with `make stan`.

Make sure these checks pass before committing changes.
Loading