11 Go integration tests that start an in-process server with in-memory SQLite, register agents with API keys, and make real JSON-RPC 2.0 calls to /mcp. Tests cover: direct messages, channels, search, threads, agent discovery, inbox filters, claim/mark-done, tool listing, auth enforcement, private channels, and read-state tracking. Run with: make test-e2e Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45 lines
1.0 KiB
Makefile
45 lines
1.0 KiB
Makefile
.PHONY: build test test-e2e dev web clean lint hooks
|
|
|
|
BINARY := synapbus
|
|
MODULE := github.com/synapbus/synapbus
|
|
BUILD_DIR := bin
|
|
VERSION ?= dev
|
|
LDFLAGS := -s -w -X main.version=$(VERSION)
|
|
|
|
CGO_ENABLED := 0
|
|
|
|
build: web
|
|
CGO_ENABLED=$(CGO_ENABLED) go build -ldflags "$(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY) ./cmd/synapbus
|
|
|
|
test:
|
|
CGO_ENABLED=$(CGO_ENABLED) go test ./... -v -count=1
|
|
|
|
test-e2e:
|
|
CGO_ENABLED=$(CGO_ENABLED) go test ./tests/integration/... -v -count=1
|
|
|
|
dev:
|
|
CGO_ENABLED=$(CGO_ENABLED) go run ./cmd/synapbus serve
|
|
|
|
web:
|
|
cd web && npm install --legacy-peer-deps && npm run build
|
|
rm -rf internal/web/dist
|
|
cp -r web/build internal/web/dist
|
|
|
|
clean:
|
|
rm -rf $(BUILD_DIR)
|
|
rm -rf web/node_modules web/build
|
|
rm -rf data
|
|
|
|
lint:
|
|
golangci-lint run ./...
|
|
|
|
hooks:
|
|
@echo "Installing git hooks..."
|
|
@mkdir -p scripts/hooks
|
|
@chmod +x scripts/hooks/pre-commit scripts/hooks/pre-push
|
|
@ln -sf ../../scripts/hooks/pre-commit .git/hooks/pre-commit
|
|
@ln -sf ../../scripts/hooks/pre-push .git/hooks/pre-push
|
|
@echo "✅ Git hooks installed"
|
|
|
|
.DEFAULT_GOAL := build
|