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 } }