Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ build-all-platforms: clean tidy format lint ## Build the project for all platfor
test: ## Run the tests
go test -count=1 -v ./...

.PHONY: test-update-snapshots
test-update-snapshots: ## Update test snapshots for toolset tests
UPDATE_TOOLSETS_JSON=1 go test -count=1 -v ./pkg/mcp

.PHONY: format
format: ## Format the code
go fmt ./...
Expand Down
4 changes: 4 additions & 0 deletions pkg/mcp/toolsets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ func (s *ToolsetsSuite) InitMcpClient() {
s.McpClient = test.NewMcpClient(s.T(), s.mcpServer.ServeHTTP())
}

// assertJsonSnapshot compares actual data against a JSON snapshot file.
// When the snapshot doesn't match, the test fails with instructions on how to update it.
// Set UPDATE_TOOLSETS_JSON=1 environment variable to regenerate snapshot files.
// Example: UPDATE_TOOLSETS_JSON=1 go test ./pkg/mcp -v
func (s *ToolsetsSuite) assertJsonSnapshot(snapshotFile string, actual any) {
_, file, _, _ := runtime.Caller(1)
snapshotPath := filepath.Join(filepath.Dir(file), "testdata", snapshotFile)
Expand Down