-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 1.09 KB
/
Makefile
File metadata and controls
41 lines (31 loc) · 1.09 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
test:
go test --race ./...
test-e2e:
go test -v -run TestServerE2E ./pkg/cmd/
test-e2e-with-redis:
@echo "Cleaning up any existing Redis container..."
@docker rm -f mit-test-redis > /dev/null 2>&1 || true
@echo "Starting Redis container..."
@docker run -d --rm --name mit-test-redis -p 6379:6379 redis:alpine > /dev/null
@echo "Waiting for Redis to be ready..."
@timeout 30 sh -c 'until docker exec mit-test-redis redis-cli ping 2>/dev/null | grep -q PONG; do sleep 0.5; done' || (echo "Redis failed to start"; docker rm -f mit-test-redis > /dev/null 2>&1; exit 1)
@echo "Running E2E tests..."
@go test -v -run TestServerE2E ./pkg/cmd/ || (docker rm -f mit-test-redis > /dev/null 2>&1; exit 1)
@echo "Stopping Redis container..."
@docker rm -f mit-test-redis > /dev/null 2>&1
test-coverage:
go test -coverprofile=coverage.out -covermode=atomic -v -race ./...
build:
go build -v ./...
lint:
golangci-lint run
mocks:
mockery
mod-tidy:
go mod tidy
fmt:
gofmt -w .
api-doc:
rm -rf ./pkg/api/docs && swag init -g ./pkg/api/api.go -o ./pkg/api/docs -ot go
docker-up:
docker-compose up --build