schon/scripts/Windows/test.ps1
Egor fureunoir Gorbunov bf6b9f4424 Features: 1) Add backup_task to manage database and media backups; 2) Introduce periodic scheduling for backup_task via Celery Beat;
Fixes: 1) Apply `--omit` filter for test coverage reports to exclude unnecessary files; 2) Replace `services_data` volume mounts with named Docker volumes for consistency and cleanup (e.g., `postgres-data`, `redis-data`);

Extra: 1) Remove `services_data` from `.gitignore`, Docker-related cleanup in uninstall scripts; 2) Simplified related files removal scripts for Unix and Windows; 3) Minor adjustments in documentation comments.
2025-11-13 17:14:00 +03:00

38 lines
1.3 KiB
PowerShell

param(
[Alias('r')]
[string]$Report = ''
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
& .\scripts\Windows\starter.ps1
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
if (-not $PSBoundParameters.ContainsKey('Report') -or [string]::IsNullOrWhiteSpace($Report)) {
docker compose exec app uv run coverage erase
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
docker compose exec app uv run coverage run --source='.' --omit='storefront/*,monitoring/*,Dockerfiles/*,*/__init__.py,*/tests/*,*/migrations/*,manage.py,evibes/*' manage.py test
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
docker compose exec app uv run coverage report -m
exit $LASTEXITCODE
}
switch ($Report.ToLowerInvariant()) {
'xml' {
docker compose exec app uv run coverage xml --omit='storefront/*,monitoring/*,Dockerfiles/*,*/__init__.py,*/tests/*,*/migrations/*,manage.py,evibes/*'
exit $LASTEXITCODE
}
'html' {
docker compose exec app uv run coverage html --omit='storefront/*,monitoring/*,Dockerfiles/*,*/__init__.py,*/tests/*,*/migrations/*,manage.py,evibes/*'
exit $LASTEXITCODE
}
default {
Write-Error "Invalid -Report/-r value '$Report'. Expected 'xml' or 'html'."
exit 1
}
}