setup coverate report generation
This commit is contained in:
44
run-coverage.bat
Normal file
44
run-coverage.bat
Normal file
@ -0,0 +1,44 @@
|
||||
@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
|
||||
Reference in New Issue
Block a user