Skip to content

Commit 6065719

Browse files
test: create separate target for e2e tests
1 parent cc99550 commit 6065719

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

Makefile

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,27 @@ deps:
4343
go mod download
4444
@echo "Verifying dependencies..."
4545
go mod verify
46-
@echo "✓ Dependencies ready!"
46+
@echo "✓ Dependencies ready!"e
4747

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..."
5252
@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 $$(go list ./... | grep -v e2e_tests)
54+
@echo "✓ Unit tests passed!"
55+
56+
# Run E2E tests (Linux only, needs sudo)
57+
.PHONY: e2e-test
58+
e2e-test:
59+
@echo "Running E2E tests..."
60+
@which go > /dev/null || (echo "Go not found in PATH" && exit 1)
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!"
5567

5668
# Run tests with coverage (needs sudo for E2E tests)
5769
.PHONY: test-coverage

0 commit comments

Comments
 (0)