Repository navigation
Expand file tree
/
Copy pathrun_tests.ps1
More file actions
47 lines (39 loc) · 1.7 KB
/
Copy pathrun_tests.ps1
File metadata and controls
47 lines (39 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
param(
[switch]$Standalone = $false
)
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " Bookmark Manager - Test Runner" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
if ($Standalone) {
Write-Host "Mode: Standalone (separate test environment)" -ForegroundColor Yellow
Write-Host ""
Write-Host "Starting test environment..." -ForegroundColor Green
docker-compose -f docker-compose.test.yaml up --build --abort-on-container-exit
Write-Host ""
Write-Host "Cleaning up..." -ForegroundColor Yellow
docker-compose -f docker-compose.test.yaml down
} else {
Write-Host "Mode: With full stack" -ForegroundColor Yellow
Write-Host ""
Write-Host "Step 1: Starting all services..." -ForegroundColor Green
docker-compose up -d postgres backend frontend nginx
Write-Host ""
Write-Host "Step 2: Waiting for services to be ready..." -ForegroundColor Green
Start-Sleep -Seconds 10
Write-Host ""
Write-Host "Step 3: Running tests..." -ForegroundColor Green
docker-compose up --build test
Write-Host ""
Write-Host "Step 4: Viewing test results..." -ForegroundColor Green
docker-compose logs test
}
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " Tests completed!" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Usage tips:" -ForegroundColor Yellow
Write-Host " Full stack with tests: .\run_tests.ps1" -ForegroundColor White
Write-Host " Only tests (isolated): .\run_tests.ps1 -Standalone" -ForegroundColor White
Write-Host ""