1
1
# System Monitor Server Makefile
2
2
# This Makefile provides common build, test, and development tasks
3
3
4
- .PHONY : help build test clean run install deps lint fmt vet
4
+ .PHONY : help build test test-coverage coverage clean run install deps lint fmt vet
5
5
6
6
# Default target
7
7
help :
8
8
@echo " Available targets:"
9
- @echo " build - Build the system-monitor-server binary"
10
- @echo " test - Run all tests"
11
- @echo " clean - Clean build artifacts"
12
- @echo " run - Run the server in stdio mode"
13
- @echo " install - Install the binary to GOPATH/bin"
14
- @echo " deps - Download and verify dependencies"
15
- @echo " lint - Run linters"
16
- @echo " fmt - Format code"
17
- @echo " vet - Run go vet"
18
- @echo " docker - Build Docker image"
19
- @echo " examples - Run example commands"
9
+ @echo " build - Build the system-monitor-server binary"
10
+ @echo " test - Run all tests"
11
+ @echo " test-coverage - Run comprehensive test suite with coverage report"
12
+ @echo " coverage - Generate coverage report only"
13
+ @echo " clean - Clean build artifacts"
14
+ @echo " run - Run the server in stdio mode"
15
+ @echo " install - Install the binary to GOPATH/bin"
16
+ @echo " deps - Download and verify dependencies"
17
+ @echo " lint - Run linters"
18
+ @echo " fmt - Format code"
19
+ @echo " vet - Run go vet"
20
+ @echo " docker - Build Docker image"
21
+ @echo " examples - Run example commands"
20
22
21
23
# Build the binary
22
24
build :
@@ -27,15 +29,27 @@ build:
27
29
# Run tests
28
30
test :
29
31
@echo " Running tests..."
30
- @go test -v -race -coverprofile=coverage.out ./...
31
- @go tool cover -html=coverage.out -o coverage.html
32
- @echo " Test coverage report: coverage.html"
32
+ @go test -v -race ./...
33
+ @echo " Tests completed!"
34
+
35
+ # Run comprehensive test suite with coverage
36
+ test-coverage :
37
+ @echo " Running comprehensive test suite with coverage..."
38
+ @chmod +x ./test_coverage.sh
39
+ @./test_coverage.sh
40
+
41
+ # Generate coverage report only
42
+ coverage :
43
+ @echo " Generating coverage report..."
44
+ @chmod +x ./test_coverage.sh
45
+ @./test_coverage.sh
33
46
34
47
# Clean build artifacts
35
48
clean :
36
49
@echo " Cleaning build artifacts..."
37
50
@rm -f system-monitor-server
38
51
@rm -f coverage.out coverage.html
52
+ @rm -rf coverage/
39
53
@go clean
40
54
41
55
# Run the server in stdio mode
0 commit comments