forked from Stellabill/stellabill-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-health.bat
More file actions
84 lines (72 loc) · 1.97 KB
/
Copy pathtest-health.bat
File metadata and controls
84 lines (72 loc) · 1.97 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@echo off
REM Test script for health check implementation (Windows)
REM Run all health-related tests with coverage
setlocal enabledelayedexpansion
echo.
echo ================================
echo Health Check Test Suite (Windows)
echo ================================
echo.
REM Run liveness/readiness probe tests
echo Running probe tests...
go test ./internal/handlers -v -run "TestLiveness|TestReadiness|TestHealth" -timeout 30s
if !errorlevel! neq 0 (
echo Test failed!
exit /b 1
)
echo.
echo Running dependency health check tests...
go test ./internal/handlers -v -run "TestCheckDatabase|TestCheckOutbox" -timeout 30s
if !errorlevel! neq 0 (
echo Test failed!
exit /b 1
)
echo.
echo Running status logic tests...
go test ./internal/handlers -v -run "TestDeriveOverallStatus" -timeout 10s
if !errorlevel! neq 0 (
echo Test failed!
exit /b 1
)
echo.
echo Running concurrency tests...
go test ./internal/handlers -v -run "TestCheckAllDependencies" -timeout 30s
if !errorlevel! neq 0 (
echo Test failed!
exit /b 1
)
echo.
echo Running security tests...
go test ./internal/handlers -v -run "TestSecurityNoSensitiveData" -timeout 10s
if !errorlevel! neq 0 (
echo Test failed!
exit /b 1
)
echo.
echo Running integration tests...
go test ./internal/handlers -v -run "TestLifecycleEndpointsIntegration" -timeout 10s
if !errorlevel! neq 0 (
echo Test failed!
exit /b 1
)
echo.
echo ================================
echo Full test suite with coverage...
echo ================================
echo.
REM Run all handler tests with coverage
go test ./internal/handlers/... -v -cover -coverprofile=health-coverage.out
if !errorlevel! neq 0 (
echo Test failed!
exit /b 1
)
echo.
echo ================================
echo Coverage Report
echo ================================
go tool cover -func=health-coverage.out | find "health.go"
echo.
echo All tests passed!
echo.
echo Optional: View detailed coverage report
echo go tool cover -html=health-coverage.out