plugins { id 'base' } tasks.register('frontendLint', Exec) { description = 'Run ESLint in the frontend directory' workingDir = file("${rootProject.projectDir}/frontend") commandLine 'npm', 'run', 'lint' } tasks.register('frontendTest', Exec) { description = 'Run Vitest in the frontend directory' dependsOn frontendLint workingDir = file("${rootProject.projectDir}/frontend") commandLine 'npm', 'run', 'test' } tasks.register('frontendCoverage', Exec) { description = 'Run Vitest with coverage in the frontend directory' workingDir = file("${rootProject.projectDir}/frontend") commandLine 'npm', 'run', 'test:coverage' } tasks.register('coverage') { group = 'verification' description = 'Run backend + frontend tests with coverage thresholds' dependsOn(':backend:jacocoTestReport', 'frontendCoverage') } tasks.register('frontendE2E', Exec) { group = 'verification' description = 'Run Playwright E2E tests in Docker (same stack as Forgejo CI)' dependsOn frontendTest workingDir = rootProject.projectDir environment 'POSTGRES_DB', 'bilhej' environment 'POSTGRES_USER', 'bilhej' environment 'POSTGRES_PASSWORD', 'test_pw_ci_123' environment 'JWT_SECRET', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' environment 'STRIPE_SECRET_KEY', 'sk_test_fake' environment 'STRIPE_WEBHOOK_SECRET', 'whsec_fake' environment 'STRIPE_PRICE_ID', 'price_fake' commandLine 'docker', 'compose', '-f', 'docker-compose.e2e.yml', 'up', '--build', '--abort-on-container-exit', '--exit-code-from', 'playwright' } tasks.named('check').configure { description = 'Full verification: frontend lint/tests, backend tests+coverage, E2E' dependsOn ':backend:check', frontendE2E } tasks.register('up', Exec) { description = 'Start all services via Docker Compose' workingDir = rootProject.projectDir commandLine 'docker', 'compose', 'up', '-d' } tasks.register('down', Exec) { description = 'Stop all Docker Compose services' workingDir = rootProject.projectDir commandLine 'docker', 'compose', 'down' } tasks.register('reset', Exec) { description = 'Wipe database and restart all services' workingDir = rootProject.projectDir commandLine 'bash', '-c', 'docker compose down -v && docker compose up -d' }