-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (26 loc) · 913 Bytes
/
Makefile
File metadata and controls
33 lines (26 loc) · 913 Bytes
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
.PHONY: build test test-unit test-integration test-integration-up test-integration-down clean
# Build the binary
build:
go build -o bin/selfhost_s3 ./cmd/selfhost_s3
# Run all tests (unit + integration if container is running)
test:
go test ./...
# Run unit tests only (excludes integration tests)
test-unit:
go test ./internal/... ./cmd/...
# Run integration tests (requires test container)
test-integration:
go test ./integration/... -v
# Start test container and run integration tests
test-integration-up:
docker compose -f compose.test.yaml up -d --build
@echo "Waiting for container to be ready..."
@sleep 2
go clean -testcache && go test ./integration/... -v 2>&1 | tee /tmp/integration-test.log; \
if grep -q "FAIL" /tmp/integration-test.log; then exit 1; fi
# Stop test container
test-integration-down:
docker compose -f compose.test.yaml down
# Clean build artifacts
clean:
rm -rf bin/