bilhej/build.gradle
Joakim Mörling 7e6124ce4a chore: add root gradle coverage and frontendCoverage tasks
- frontendCoverage: runs 'npm run test:coverage' in frontend directory
  (vitest with coverage, enforces thresholds internally)
- coverage: group='verification', runs backend jacocoTestReport and
  frontendCoverage sequentially — single command for both layers:
  ./gradlew coverage
- check task continues to run only: frontendLint → frontendTest
  (coverage verification is added per-module: jacocoTestCoverage
  Verification on backend, vitest thresholds on frontend)
2026-05-15 12:16:04 +02:00

56 lines
1.7 KiB
Groovy

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) {
description = 'Run Playwright E2E tests in Docker (CI mode)'
workingDir = file("${rootProject.projectDir}/frontend")
commandLine 'npm', 'run', 'test:e2e:ci'
}
tasks.named('check').configure {
dependsOn frontendLint, frontendTest
}
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'
}