Skip to content

Commit f5fa8c1

Browse files
committed
adding test cases and test coverage
Signed-off-by: irapandey <[email protected]>
1 parent 89893c6 commit f5fa8c1

File tree

9 files changed

+3167
-451
lines changed

9 files changed

+3167
-451
lines changed

mcp-servers/go/system-monitor-server/Makefile

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
# System Monitor Server Makefile
22
# This Makefile provides common build, test, and development tasks
33

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
55

66
# Default target
77
help:
88
@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"
2022

2123
# Build the binary
2224
build:
@@ -27,15 +29,27 @@ build:
2729
# Run tests
2830
test:
2931
@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
3346

3447
# Clean build artifacts
3548
clean:
3649
@echo "Cleaning build artifacts..."
3750
@rm -f system-monitor-server
3851
@rm -f coverage.out coverage.html
52+
@rm -rf coverage/
3953
@go clean
4054

4155
# Run the server in stdio mode

0 commit comments

Comments
 (0)