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.
38 lines
1.3 KiB
PowerShell
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
|
|
}
|
|
}
|