[Feature] TS SDK 集成测试 CI 支持
- Dominant language
- Python
- Stars
- 485
- Forks
- 81
- Avg merge
- 16h 12m
- Merged PRs (30d)
- 8
Description
**Feature Category**
- [ ] Sandbox
- [ ] Actions
- [ ] Deployments
- [x] SDK & API
- [ ] Envhub
- [ ] CLI
- [ ] Performance & Optimization
- [ ] Documentation & Examples
**Problem Statement**
**Proposed Solution**
- 新增 .github/workflows/ts-sdk-ci.yml,包含 test(单测,跑在 ubuntu-latest)和 integration-test(集成测试,跑在 self-hosted,需要 Docker + Ray)两个 job。
- 把 TS SDK 集成测试中的镜像、集群参数化为环境变量 ROCK_TEST_IMAGE / ROCK_TEST_CLUSTER,保留原硬编码值作为 fallback,对原作者本地开发体验零影响。
- 新增 rock-conf/rock-ci.yml,使用独立 namespace rock-sandbox-ci,warmup 镜像为公开的 python:3.11,避免和开发同事共用 --env test 的 Ray namespace 互相影响。
- 修复 docker_run_with_uv.sh:在 rm -rf $WRITABLE_PROJECT 之前先 cd /,防止 rocklet 继承被删除的 CWD。
**Detailed Feature Description**
- CI workflow:integration-test job 顺序为 setup Python 3.11 → 装 uv → uv sync --all-extras → docker pull python:3.11 → nohup uv run admin --env ci --role admin --port 8080 启动 admin 并轮询日志确认 ready → setup Node 20 + pnpm → pnpm test:integration。失败时 tail admin 日志和 docker ps -a 帮助排查。
- 环境变量支持:ROCK_BASE_URL、ROCK_TEST_IMAGE、ROCK_TEST_CLUSTER、ROCK_DEFAULT_MEMORY=2g、ROCK_DEFAULT_CPUS=1、ROCK_STARTUP_TIMEOUT=120,确保单台 runner 能依次起 4+ 个 sandbox 而不耗尽资源。
- CWD 修复:cd / + 注释说明原因,避免 PR #857 引入的副作用影响 rocklet 启动后的 bash 输出。
- 涉及文件:
- .github/workflows/ts-sdk-ci.yml(新建)
- rock-conf/rock-ci.yml(新建)
- rock/ts-sdk/tests/integration/sandbox-lifecycle.test.ts(参数化 2 行)
- rock/ts-sdk/tests/integration/file-system.test.ts(参数化 2 行)
- rock/rocklet/local_files/docker_run_with_uv.sh(加 cd / + 注释)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with .github/workflows/ts-sdk-ci.yml and the two integration tests under rock/ts-sdk/tests/integration, then inspect rock-conf/rock-ci.yml and docker_run_with_uv.sh. Run the existing TypeScript tests first and verify the new workflow runs unit and integration jobs with the listed environment variables. Done means CI starts the required services, tests pass, and the CWD issue is documented and corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, github-actions, node.js, python, typescript
- Domain
- api, ci-cd, devops, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100