-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
104 lines (84 loc) · 2.71 KB
/
Copy pathMakefile
File metadata and controls
104 lines (84 loc) · 2.71 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Twinkly Makefile
.PHONY: build test clean install run help test-integration docker-test
# Build the proxy
build:
go build -o twinkly .
# Run all tests
test:
go test ./...
# Run tests with verbose output
test-verbose:
go test -v ./...
# Run specific test suites
test-config:
go test -v -run TestConfigAdapter
test-validator:
go test -v -run TestResultValidator
test-security:
go test -v -run TestSecurity
# Run integration tests (requires databases)
test-integration:
go test -v ./test/integration/...
# Run integration tests with Docker
docker-test:
docker-compose -f docker-compose.test.yml up --build --abort-on-container-exit
docker-compose -f docker-compose.test.yml down
# Start test databases only
test-db-up:
docker-compose -f docker-compose.test.yml up -d postgres yugabytedb
# Stop test databases
test-db-down:
docker-compose -f docker-compose.test.yml down
# Run the proxy
run: build
./twinkly
# Run proxy with test configuration
run-test: build
TWINKLY_CONFIG=test/config/integration-test.conf ./twinkly
# Clean build artifacts
clean:
rm -f twinkly
go clean
docker-compose -f docker-compose.test.yml down -v
# Development workflow: start databases and run tests
dev-test: test-db-up
sleep 10 # Wait for databases to be ready
make test-integration
make test-db-down
# Install dependencies
install:
go mod tidy
go mod download
# Format code
fmt:
go fmt ./...
# Run linter
lint:
golangci-lint run
# Build for multiple platforms
build-all:
GOOS=linux GOARCH=amd64 go build -o twinkly-linux-amd64 .
GOOS=darwin GOARCH=amd64 go build -o twinkly-darwin-amd64 .
GOOS=windows GOARCH=amd64 go build -o twinkly-windows-amd64.exe .
# Show help
help:
@echo "Available targets:"
@echo " build - Build the proxy"
@echo " test - Run all unit tests"
@echo " test-verbose - Run tests with verbose output"
@echo " test-integration - Run integration tests (requires databases)"
@echo " test-config - Run configuration tests"
@echo " test-validator - Run result validator tests"
@echo " test-security - Run security tests"
@echo " docker-test - Run full integration tests with Docker"
@echo " test-db-up - Start test databases only"
@echo " test-db-down - Stop test databases"
@echo " dev-test - Full development test cycle"
@echo " run - Build and run the proxy"
@echo " run-test - Run proxy with test configuration"
@echo " clean - Clean build artifacts and containers"
@echo " install - Install dependencies"
@echo " fmt - Format code"
@echo " lint - Run linter"
@echo " build-all - Build for multiple platforms"
@echo " help - Show this help message"