Phase 2 Testing: setup command (#216) #218

Closed
opened 2026-05-12 10:13:42 +00:00 by xingyue · 1 comment
Owner

验证目标

uncaged-workflow setup 命令能引导用户配置 provider/model 并写入 workflow.yaml。同时支持 CLI 模式让 agent 非交互调用。

Ref: #216

测试步骤

CLI 模式(agent 友好)

  • Step 1: CLI 模式配置 provider + model

    export UNCAGED_WORKFLOW_STORAGE_ROOT=/tmp/test-setup
    rm -rf /tmp/test-setup
    uncaged-workflow setup \
      --provider dashscope \
      --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 \
      --api-key sk-test123 \
      --default-model dashscope/qwen-plus
    

    预期: 成功,/tmp/test-setup/workflow.yaml 被创建且 config 段包含 provider 和 models.default

  • Step 2: 验证 workflow.yaml 内容

    cat /tmp/test-setup/workflow.yaml
    

    预期: config.providers.dashscope 有 baseUrl 和 apiKey,config.models.default = "dashscope/qwen-plus"

  • Step 3: CLI 模式 + init workspace

    cd /tmp && rm -rf test-setup-ws
    uncaged-workflow setup \
      --provider openai --base-url https://api.openai.com/v1 --api-key sk-test \
      --default-model openai/gpt-4o \
      --init-workspace test-setup-ws
    

    预期: 同时创建 workflow.yaml 配置和 test-setup-ws/ workspace 目录

  • Step 4: 重复执行不报错(幂等)

    uncaged-workflow setup \
      --provider dashscope \
      --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 \
      --api-key sk-newkey \
      --default-model dashscope/qwen-plus
    

    预期: 更新已有 provider 的 apiKey,不丢失 workflows 段

交互模式

  • Step 5: 交互模式引导

    uncaged-workflow setup
    

    预期: 依次提示输入 provider name、baseUrl、apiKey、default model

  • Step 6: bun test 通过 — 无回归

验证完成标准

所有 checkbox 打勾
现有测试通过

## 验证目标 `uncaged-workflow setup` 命令能引导用户配置 provider/model 并写入 `workflow.yaml`。同时支持 CLI 模式让 agent 非交互调用。 Ref: #216 ## 测试步骤 ### CLI 模式(agent 友好) - [ ] **Step 1: CLI 模式配置 provider + model** ```bash export UNCAGED_WORKFLOW_STORAGE_ROOT=/tmp/test-setup rm -rf /tmp/test-setup uncaged-workflow setup \ --provider dashscope \ --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 \ --api-key sk-test123 \ --default-model dashscope/qwen-plus ``` **预期:** 成功,`/tmp/test-setup/workflow.yaml` 被创建且 `config` 段包含 provider 和 models.default - [ ] **Step 2: 验证 workflow.yaml 内容** ```bash cat /tmp/test-setup/workflow.yaml ``` **预期:** config.providers.dashscope 有 baseUrl 和 apiKey,config.models.default = "dashscope/qwen-plus" - [ ] **Step 3: CLI 模式 + init workspace** ```bash cd /tmp && rm -rf test-setup-ws uncaged-workflow setup \ --provider openai --base-url https://api.openai.com/v1 --api-key sk-test \ --default-model openai/gpt-4o \ --init-workspace test-setup-ws ``` **预期:** 同时创建 workflow.yaml 配置和 test-setup-ws/ workspace 目录 - [ ] **Step 4: 重复执行不报错(幂等)** ```bash uncaged-workflow setup \ --provider dashscope \ --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 \ --api-key sk-newkey \ --default-model dashscope/qwen-plus ``` **预期:** 更新已有 provider 的 apiKey,不丢失 workflows 段 ### 交互模式 - [ ] **Step 5: 交互模式引导** ```bash uncaged-workflow setup ``` **预期:** 依次提示输入 provider name、baseUrl、apiKey、default model - [ ] **Step 6: bun test 通过** — 无回归 ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ 现有测试通过
Author
Owner

验证结果

Step 1 CLI 模式配置 → workflow.yaml 创建成功
Step 2 YAML 内容正确:providers.dashscope.baseUrl/apiKey + models.default
Step 3 CLI + init-workspace → 配置 + workspace 目录同时创建
Step 4 幂等更新:apiKey 更新,保留多 provider,不丢失 workflows 段
Step 5 交互模式(开发时手动验证,含 preset 选择列表)
Step 6 211 tests pass, 0 fail

## 验证结果 ✅ **Step 1** CLI 模式配置 → workflow.yaml 创建成功 ✅ **Step 2** YAML 内容正确:providers.dashscope.baseUrl/apiKey + models.default ✅ **Step 3** CLI + init-workspace → 配置 + workspace 目录同时创建 ✅ **Step 4** 幂等更新:apiKey 更新,保留多 provider,不丢失 workflows 段 ✅ **Step 5** 交互模式(开发时手动验证,含 preset 选择列表) ✅ **Step 6** 211 tests pass, 0 fail
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#218