File tree 5 files changed +35
-10
lines changed
5 files changed +35
-10
lines changed Original file line number Diff line number Diff line change 24
24
with :
25
25
version : v1.64
26
26
27
- test :
28
- name : Test
27
+ test-unit :
28
+ name : Test Unit
29
+ runs-on : ubuntu-latest
30
+ steps :
31
+ - name : Checkout code
32
+ uses : actions/checkout@v4
33
+
34
+ - name : Set up Go
35
+ uses : actions/setup-go@v5
36
+ with :
37
+ go-version : ' 1.24'
38
+ cache : true
39
+
40
+ - name : Run unit tests
41
+ run : make test-unit
42
+
43
+ test-integration :
44
+ name : Test Integration
29
45
runs-on : ubuntu-latest
30
46
steps :
31
47
- name : Checkout code
48
64
- name : Wait for Grafana server and Prometheus server to start and scrape
49
65
run : sleep 30
50
66
51
- - name : Run tests
52
- run : make test-all
67
+ - name : Run integration tests
68
+ run : make test-integration
53
69
54
70
test-cloud :
55
71
name : Test Cloud
Original file line number Diff line number Diff line change @@ -16,16 +16,16 @@ build-image: ## Build the Docker image.
16
16
lint : # # Lint the Go code.
17
17
go tool -modfile go.tools.mod golangci-lint run
18
18
19
- .PHONY : test
20
- test : # # Run the Go unit tests.
21
- go test ./...
19
+ .PHONY : test-unit
20
+ test-unit : # # Run the unit tests (no external dependencies required) .
21
+ go test -v -tags unit ./...
22
22
23
- .PHONY : test-all
24
- test-all : # # Run the Go unit and integration tests.
23
+ .PHONY : test-integration
24
+ test-integration : # # Run only the Docker-based integration tests (Requires docker containers to be up and running) .
25
25
go test -v -tags integration ./...
26
26
27
27
.PHONY : test-cloud
28
- test-cloud : # # Run only the cloud tests.
28
+ test-cloud : # # Run only the cloud-based tests (requires cloud Grafana instance and credentials) .
29
29
go test -v -tags cloud ./tools
30
30
31
31
.PHONY : run
Original file line number Diff line number Diff line change
1
+ //go:build unit
2
+ // +build unit
3
+
1
4
package mcpgrafana
2
5
3
6
import (
Original file line number Diff line number Diff line change
1
+ //go:build unit
2
+ // +build unit
3
+
1
4
package tools
2
5
3
6
import (
Original file line number Diff line number Diff line change
1
+ //go:build unit
2
+ // +build unit
3
+
1
4
package mcpgrafana
2
5
3
6
import (
You can’t perform that action at this time.
0 commit comments