Some checks failed
Deploy to Test Environment / deploy-to-test (push) Failing after 43s
81 lines
2.1 KiB
Batchfile
81 lines
2.1 KiB
Batchfile
@echo off
|
|
REM Simple batch script to run integration tests with container infrastructure
|
|
|
|
echo === Flyer Crawler Integration Test Runner ===
|
|
echo.
|
|
|
|
REM Check containers
|
|
echo Checking container status...
|
|
podman ps --filter "name=flyer-crawler-postgres" --format "{{.Names}}" >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo ERROR: PostgreSQL container is not running!
|
|
echo Start it with: podman start flyer-crawler-postgres
|
|
exit /b 1
|
|
)
|
|
|
|
podman ps --filter "name=flyer-crawler-redis" --format "{{.Names}}" >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo ERROR: Redis container is not running!
|
|
echo Start it with: podman start flyer-crawler-redis
|
|
exit /b 1
|
|
)
|
|
|
|
echo [OK] Containers are running
|
|
echo.
|
|
|
|
REM Set environment variables
|
|
echo Setting environment variables...
|
|
set NODE_ENV=test
|
|
set DB_HOST=localhost
|
|
set DB_USER=postgres
|
|
set DB_PASSWORD=postgres
|
|
set DB_NAME=flyer_crawler_dev
|
|
set DB_PORT=5432
|
|
set REDIS_URL=redis://localhost:6379
|
|
set REDIS_PASSWORD=
|
|
set FRONTEND_URL=http://localhost:5173
|
|
set VITE_API_BASE_URL=http://localhost:3001/api
|
|
set JWT_SECRET=test-jwt-secret-for-integration-tests
|
|
set NODE_OPTIONS=--max-old-space-size=8192
|
|
|
|
echo [OK] Environment configured
|
|
echo.
|
|
|
|
echo Test Configuration:
|
|
echo NODE_ENV: %NODE_ENV%
|
|
echo Database: %DB_HOST%:%DB_PORT%/%DB_NAME%
|
|
echo Redis: %REDIS_URL%
|
|
echo Frontend URL: %FRONTEND_URL%
|
|
echo.
|
|
|
|
REM Verify database
|
|
echo Verifying database connection...
|
|
podman exec flyer-crawler-postgres psql -U postgres -d flyer_crawler_dev -c "SELECT 1;" >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo ERROR: Cannot connect to database!
|
|
exit /b 1
|
|
)
|
|
echo [OK] Database connection successful
|
|
echo.
|
|
|
|
REM Check URL constraints
|
|
echo Verifying URL constraints...
|
|
podman exec flyer-crawler-postgres psql -U postgres -d flyer_crawler_dev -t -A -c "SELECT COUNT(*) FROM pg_constraint WHERE conname LIKE '%%url_check';"
|
|
echo.
|
|
|
|
REM Run tests
|
|
echo === Running Integration Tests ===
|
|
echo.
|
|
|
|
npm run test:integration
|
|
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo === Integration Tests FAILED ===
|
|
exit /b 1
|
|
) else (
|
|
echo.
|
|
echo === Integration Tests PASSED ===
|
|
exit /b 0
|
|
)
|