From 5ec558bf8194c51ea1d6c21fc5a9e47fc099d467 Mon Sep 17 00:00:00 2001 From: Blizzard Date: Thu, 18 Jun 2026 11:44:31 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E5=8A=A0=20make=20test/test-go/test-w?= =?UTF-8?q?eb/test-py=20=E4=B8=80=E9=94=AE=E6=B5=8B=E8=AF=95=E7=9B=AE?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test-go: 各 Go 模块 go test(DB 集成测试无 MEMORY_TEST_DSN 自动跳过) - test-web: 前端 tsc 类型检查 - test-py: mcp-py 沙箱守卫测试(pytest 缺则用内置 harness 兜底) - test = test-go + test-web Co-Authored-By: Claude Opus 4.8 --- Makefile | 19 ++++++++++++++++++- PROGRESS.md | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 52ab845..edc28a1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: infra infra-down devnats demo e2e gateway dispatcher mcp-go mcp-py mcp-py-setup web admin desktop desktop-build tidy +.PHONY: infra infra-down devnats demo e2e test test-go test-web test-py gateway dispatcher mcp-go mcp-py mcp-py-setup web admin desktop desktop-build tidy infra: ## 启动基础设施 (NATS / Postgres / Redis / Milvus / Neo4j) docker compose up -d @@ -15,6 +15,23 @@ demo: ## 一键演示 Gateway→NATS→Dispatcher 任务流(无需 Doc e2e: ## 跑共享 bus 的端到端测试(内嵌 NATS):任务流 / 工具调用 / Token 流 cd sundynix-shared && go test ./bus/ -run 'TestTaskRoundTrip|TestToolCallRoundTrip|TestTokenStreamRoundTrip' -v +test: test-go test-web ## 跑全部测试(后端各模块 go test + 前端类型检查) + +test-go: ## 各 Go 模块单测(DB 集成测试无 MEMORY_TEST_DSN 自动跳过) + cd sundynix-shared && go test ./... + cd sundynix-gateway && go test ./... + cd sundynix-dispatcher && go test ./... + cd sundynix-mcp-go && go test ./... + +test-web: ## 前端 TypeScript 类型检查 + cd sundynix-desktop/frontend && npx tsc --noEmit + +test-py: ## mcp-py 沙箱守卫测试(需 venv;缺 pytest 用内置 harness 兜底) + cd sundynix-mcp-py && ( PYTHONPATH=src:tests .venv/bin/python -m pytest tests/ -q 2>/dev/null \ + || PYTHONPATH=src:tests .venv/bin/python -c "import test_sandbox as t; \ +fns=[getattr(t,n) for n in dir(t) if n.startswith('test_')]; \ +[ (f(),print('PASS',f.__name__)) for f in fns ]; print(f'{len(fns)} passed')" ) + gateway: cd sundynix-gateway && go run ./cmd/server diff --git a/PROGRESS.md b/PROGRESS.md index 1416102..b0a1d04 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -101,7 +101,7 @@ - [ ] PDF 导出 Wails 真机验证(不行则回退后端内嵌 CJK 字体出 PDF) - [ ] 报告生成并发健壮性(writeSections 降并发 / 加单次超时,治偶发卡顿) - [ ] MinIO 大文档改名/删除的孤儿对象 GC -- [ ] `make test` 目标(一键跑全后端测试) +- [x] `make test` 目标(test-go / test-web / test-py 一键跑) ---