Files
jaxwsdemo/run-coverage.bat

45 lines
1.3 KiB
Batchfile

@echo off
REM Script to generate code coverage reports using Docker
echo ================================================================================
echo Generating Code Coverage Reports
echo ================================================================================
echo.
REM Clean previous reports
if exist target\site\jacoco (
echo Cleaning previous coverage reports...
rmdir /s /q target\site\jacoco
echo.
)
REM Run tests with coverage
docker-compose -f docker-compose.coverage.yml up --build
echo.
echo ================================================================================
echo Coverage Report Generated
echo ================================================================================
echo.
echo HTML Report: target\site\jacoco\index.html
echo XML Report: target\site\jacoco\jacoco.xml
echo CSV Report: target\site\jacoco\jacoco.csv
echo.
echo Open the HTML report in your browser to view coverage details.
echo.
REM Clean up the coverage container
docker-compose -f docker-compose.coverage.yml down
REM Ask user if they want to open the report
set /p OPEN_REPORT="Would you like to open the coverage report now? (y/n): "
if /i "%OPEN_REPORT%"=="y" (
if exist target\site\jacoco\index.html (
start target\site\jacoco\index.html
) else (
echo Error: Coverage report not found!
)
)
pause