@@ -45,31 +45,43 @@ deps:
45
45
go mod verify
46
46
@echo " ✓ Dependencies ready!"
47
47
48
- # Run tests (needs sudo for E2E tests )
49
- .PHONY : test
50
- test :
51
- @echo " Running tests..."
48
+ # Run unit tests only (no sudo required )
49
+ .PHONY : unit- test
50
+ unit- test :
51
+ @echo " Running unit tests..."
52
52
@which go > /dev/null || (echo " Go not found in PATH" && exit 1)
53
- sudo $( shell which go) test -v -race ./...
54
- @echo " ✓ All tests passed!"
53
+ go test -v -race ./proxy ./tls ./rules ./audit ./cli
54
+ @echo " ✓ Unit tests passed!"
55
55
56
- # Run tests with coverage ( needs sudo for E2E tests )
57
- .PHONY : test-coverage
58
- test-coverage :
59
- @echo " Running tests with coverage ..."
56
+ # Run E2E tests (Linux only, needs sudo)
57
+ .PHONY : e2e-test
58
+ e2e-test :
59
+ @echo " Running E2E tests ..."
60
60
@which go > /dev/null || (echo " Go not found in PATH" && exit 1)
61
- sudo $(shell which go) test -v -race -coverprofile=coverage.out ./...
61
+ @if [ " $$ (uname)" != " Linux" ]; then \
62
+ echo " E2E tests require Linux platform. Current platform: $$ (uname)" ; \
63
+ exit 1; \
64
+ fi
65
+ sudo $(shell which go) test -v -race ./e2e_tests
66
+ @echo " ✓ E2E tests passed!"
67
+
68
+ # Run unit tests with coverage
69
+ .PHONY : unit-test-coverage
70
+ unit-test-coverage :
71
+ @echo " Running unit tests with coverage..."
72
+ @which go > /dev/null || (echo " Go not found in PATH" && exit 1)
73
+ go test -v -race -coverprofile=coverage.out ./proxy ./tls ./rules ./audit ./cli
62
74
$(shell which go) tool cover -html=coverage.out -o coverage.html
63
- @echo " ✓ Coverage report generated: coverage.html"
75
+ @echo " ✓ Unit test coverage report generated: coverage.html"
64
76
65
- # CI checks (deps, test, build)
77
+ # CI checks (deps, unit-test, e2e- test, build)
66
78
.PHONY : ci
67
- ci : deps test build
79
+ ci : deps unit-test e2e- test build
68
80
@echo " ✓ All CI checks passed!"
69
81
70
82
# CI checks with coverage
71
83
.PHONY : ci-coverage
72
- ci-coverage : deps test-coverage build
84
+ ci-coverage : deps unit- test-coverage e2e-test build
73
85
@echo " ✓ All CI checks with coverage passed!"
74
86
75
87
# Prepare release archives
@@ -143,8 +155,9 @@ help:
143
155
@echo " build Build for current platform"
144
156
@echo " build-all Build for all supported platforms"
145
157
@echo " deps Download and verify dependencies"
146
- @echo " test Run tests"
147
- @echo " test-coverage Run tests with coverage report"
158
+ @echo " unit-test Run unit tests only (no sudo required)"
159
+ @echo " e2e-test Run E2E tests (Linux only, needs sudo)"
160
+ @echo " unit-test-coverage Run unit tests with coverage"
148
161
@echo " ci Run CI checks (deps + test + build)"
149
162
@echo " ci-coverage Run CI checks with coverage"
150
163
@echo " release-archives Create release archives"
0 commit comments