Shared test helper to enroll a node in API integration tests
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 84/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
从 issue 中列出的六个集成测试文件开始,比较它们重复的 join token、CSR 和 enrollment 设置。阅读 apps/api/src/testing/ 下的 testing helper,以及 fleet 的 enrollment 入口点,以确定每个测试需要返回什么。添加共享 helper,只更新这六个测试,并运行 pnpm test:integration;当它以相同的测试数量通过,且这些测试都不 import fleet/infrastructure/ 时,任务即完成。
由索引模型根据 Issue 内容生成。
描述
What
Six integration tests outside the fleet module enroll a test node by importing fleet/infrastructure/ca/x509 directly to build a certificate signing request:
apps/api/src/modules/apps/application-domains-http.integration.spec.tsapps/api/src/modules/confirmations/confirmation-http.integration.spec.tsapps/api/src/modules/deployments/agent-actions-http.integration.spec.tsapps/api/src/modules/deployments/allocation-observations.integration.spec.tsapps/api/src/modules/deployments/deployment-pipeline.integration.spec.tsapps/api/src/modules/deployments/pipeline-store.integration.spec.ts
CLAUDE.md says modules never import each other's infrastructure/. Tests are not production code, but the repeated setup also duplicates the same steps: issue a join token, build a CSR, enroll.
Proposed change
Add a shared helper in apps/api/src/testing/ (for example enroll-test-node.ts) that issues a join token, builds the CSR, enrolls a node and returns what the tests need. Use it in the six tests above and remove their direct fleet/infrastructure imports. The tests inside fleet itself can keep theirs.
Done when
- None of the files listed above imports
../fleet/infrastructure/. pnpm test:integrationpasses with the same number of tests.- Nothing changes outside
src/testing/and the six tests.
Raised in the review of #290.
- 主要语言
- TypeScript
- 星标
- 2
- 派生
- 1
- 平均合并
- 7 小时 17 分钟
- 30 天内合并 PR
- 197
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
shipkeepdev/shipkeep 的其他 Issue
-
good first issue priority:P2 track:control-plane
难度 2/5 1-3 小时 新手友好度 78/100
shipkeepdev/shipkeep#212 ·
维护者通常 1 天内回复
-
enhancement good first issue priority:P3 track:web
难度 2/5 1-3 小时 新手友好度 85/100
shipkeepdev/shipkeep#144 ·
维护者通常 1 天内回复
-
documentation good first issue priority:P3 track:control-plane
难度 2/5 1-3 小时 新手友好度 78/100
shipkeepdev/shipkeep#143 ·
维护者通常 1 天内回复
-
enhancement good first issue priority:P3 track:control-plane
难度 2/5 1-3 小时 新手友好度 85/100
shipkeepdev/shipkeep#142 ·
维护者通常 1 天内回复
-
documentation good first issue priority:P3 track:control-plane
难度 2/5 1-3 小时 新手友好度 85/100
shipkeepdev/shipkeep#141 ·
维护者通常 1 天内回复
查看 shipkeepdev/shipkeep 的全部 Issue
相似的 Issue
-
normalizePropName strips `#` characters from Figma property names instead of only the `#id` suffix未关闭
难度 2/5 1-3 小时 新手友好度 72/100
figma/code-connect#419 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
jeanibarz/knowledge-base-mcp-server#1268 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
Koenkk/zigbee-herdsman-converters#13820 ·
维护者通常 2 天内回复
-
A live recovery copy treats a large whole number and text with the same digits as the same value未关闭bug sharing & sync
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复