Holdturnering - nemt og bekymringsfrit
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗Nembadminton er udviklet som et bidrag til badmintonsporten i Danmark for at gøre det nemmere at være træner og frivillig.
Kør følgende kommandoer i din terminal
docker-compose run --rm composer install
cp .env.example .env
docker-compose up -d app
docker-compose run --rm artisan key:generate
docker-compose run --rm artisan migrate
docker-compose run --rm artisan badmintonplayer-api-import:club
docker-compose run --rm artisan db:seed RolesAndPermissionsSeeder
yarn install
yarn run dev
Opsætning af auth via password
docker-compose run --rm artisan passport:keys
docker-compose run --rm artisan passport:client --password
Ændre i .env, variablerne PASSPORT_CLIENT_ID og PASSPORT_CLIENT_SECRET
Opret en bruger http://localhost/new-user
Run bin/preview for a separate local instance with BC37 Amager's 2025/2026 showcase Season. It prints the URL and login; stop it with bin/preview down.
Select 2025/2026 under Holdrunder (the date filter initially selects the current season). TeamRound names identify examples of cancellations, Reserve Players, Paper Squads and draft ordering errors. Team setup and Lineups are adapted for these examples, not an exact historical record.
PreviewDataSeeder is independent of browser-test fixtures. Its allowlisted source fixture contains Members, seven historical Ranking Lists and participation in rounds 1–11 from BC37 Clubhouse 126, plus a small reserve pool. Production accounts, contacts, birthdates, private messages and sharing identifiers are excluded. bin/export-preview-data CONTAINER OUTPUT.json regenerates the fixture from an isolated holdkamp_prod import; the container supplies MYSQL_ROOT_PASSWORD. Never import a production dump into the preview itself.
Browser tests use Laravel Dusk and are located in tests/Browser/.
Run locally:
Start the application services. app remains available on port 80, while the Dusk application uses artisan-serve on port 8000:
docker compose up -d app artisan-serve selenium
Keep the Vite development server running in a separate terminal. Dusk pages use the URL in public/hot when that file exists, so the browser page will be blank if Vite is unavailable.
yarn run dev
artisan-serve mounts the project at a different path than app, so the public storage link must be relative for downloads such as CSV exports to resolve:
ln -sfn ../storage/app/public public/storage
Run the browser tests:
docker compose run --rm artisan dusk
Run one test class or method:
docker compose run --rm artisan dusk --filter=TeamFightConstruct13KampsTest
docker compose run --rm artisan dusk --filter=test_user_can_construct_holdrunde_with_13_kamps_hold
Re-run only failed tests (keep the JUnit report on the shared project volume):
docker compose run --rm artisan dusk --log-junit=storage/logs/dusk-results.xml
docker compose run --rm artisan dusk:retry-failed storage/logs/dusk-results.xml
The host can open the Dusk application at http://localhost:8000. Selenium shares the Compose network and uses APP_URL=http://artisan-serve, which reaches the service directly on its internal port 80.
Run in CI:
Browser tests are slow, so they skip draft PRs. Open a PR as a draft and mark it ready for review when its code and UI changes are done. The tests run when a PR is opened as ready or marked ready, and again on every later push. They also run on every push to master. A passing run is not required to merge.
To rerun without pushing, convert the PR to draft and mark it ready again, or run the workflow manually: Actions > "Browser testing" > "Run workflow" (or gh workflow run "Browser testing" --ref my-branch).
Failed browser tests are automatically retried once before the workflow is marked as failed.
The suite runs in 4 parallel jobs ("Browser tests (1/4)" to "(4/4)"), each with its own database, app server and browser. bin/dusk-shard spreads the test classes over the jobs by their duration in tests/Browser/timings.json; run bin/dusk-shard --plan 4 to see the split. A class missing from that file counts as 30 seconds, so new tests need no change there. Update the file when the jobs' durations drift apart.
Forslår en feature: https://github.com/dansk-badminton-tech/nembadminton/issues/new/choose
Fundet en fejl?: https://github.com/dansk-badminton-tech/nembadminton/issues/new/choose
Project: https://github.com/dansk-badminton-tech/nembadminton/projects/2