Skip to content

Commit 15d84df

Browse files
committed
feat(ci): add tests and coverage
1 parent 74e6bfa commit 15d84df

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

.github/workflows/snapshot.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,43 @@ on:
77

88
jobs:
99

10-
go-releaser:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version-file: go.mod
23+
24+
- name: Run tests
25+
run: |
26+
go test \
27+
-race \
28+
-count=1 \
29+
-vet=all \
30+
-timeout 3m \
31+
{{.CLI_ARGS}} \
32+
-coverpkg=./... \
33+
-covermode=atomic \
34+
-coverprofile=coverage.out \
35+
./...
36+
go tool cover \
37+
-html=coverage.out \
38+
-o coverage.html
39+
40+
- name: Upload assets
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: coverage
44+
path: coverage.*
45+
46+
build:
1147
runs-on: ubuntu-latest
1248
steps:
1349

Taskfile.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ tasks:
1515
go mod tidy
1616
go mod download
1717
18+
test:
19+
desc: Run test suite
20+
silent: true
21+
cmd: |
22+
go test \
23+
-race \
24+
-count=1 \
25+
-vet=all \
26+
-timeout 3m \
27+
{{.CLI_ARGS}} \
28+
./...
29+
1830
build:
1931
desc: Build application binary
2032
silent: true

pkg/tools/connect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (t *Connect) Handler(ctx context.Context, request mcp.CallToolRequest) (*mc
134134
return fmt.Errorf("failed to convert account resource to text resource")
135135
}
136136
var ar accountResource
137-
err = json.Unmarshal([]byte(accountTextResource.Text), &ar)
137+
err := json.Unmarshal([]byte(accountTextResource.Text), &ar)
138138
if err != nil {
139139
return fmt.Errorf("failed to unmarshal account resource: %w", err)
140140
}

0 commit comments

Comments
 (0)