Skip to content

[BUG] tests/run_tests.sh 硬编码个人 conda 路径,其他环境一行测试都跑不起来 #276

Closed

Description

@codeasier

Bug 描述

tests/run_tests.sh 的 activate_conda() 写死了作者本机路径 /Users/test1/liuyekang/miniconda3/etc/profile.d/conda.sh 和环境名 conda activate openclaw,找不到就 exit 1。这不是可移植的测试入口:同事机器、CI 容器、Windows 上执行都会立即失败。

脚本还会把产物写到仓库内 test_reports/(htmlcov、xml),而 .gitignore 并未忽略该目录。AGENTS.md 已经点名这一状态:tests/run_tests.sh assumes a developer-specific Conda path and writes test_reports/; prefer direct pytest。

复现步骤

  1. 在非作者机器 clone 仓库
  2. 执行 bash tests/run_tests.sh
  3. 观察脚本在 activate_conda 阶段直接 exit 1,一行测试都未运行

预期行为

仓库自带的测试入口在任意已安装依赖的环境可运行,不依赖个人绝对路径或个人 conda 环境名。

实际行为

第 21–27 行硬编码 /Users/test1/liuyekang/miniconda3 与 openclaw;路径不存在时 exit 1。该脚本未被任何 CI 作业调用,README 与 AGENTS.md 的推荐流程也不使用它。

操作系统

macOS

Python 版本

3.13.11

pt-snap-cli 版本

0.4.0(HEAD f876665,v0.4.1-4-gf876665)

日志/错误信息

$ bash tests/run_tests.sh
>>> 激活 conda 环境...
✗ Conda 初始化脚本不存在

$ grep -n "miniconda3\|openclaw" tests/run_tests.sh
23:    if [ -f "/Users/test1/liuyekang/miniconda3/etc/profile.d/conda.sh" ]; then
24:        . /Users/test1/liuyekang/miniconda3/etc/profile.d/conda.sh
25:        conda activate openclaw

补充信息

.gitignore 不含 test_reports/(已核对);脚本一旦在别人机器上跑通,还会额外产生未跟踪目录。

Activity

  1. codeasier commented on Nov 1, 2026

    @codeasier
    OwnerAuthor

    Implemented by PR #281: the Bash test runner uses the active interpreter or explicit PYTHON instead of personal Conda paths; validates/forwards selectors, preserves exact exit codes, supports portable/custom report paths and a genuinely no-report quick mode, and ignores test_reports. Recorder subprocess regressions include Windows path forms without accessing external paths.

    Merged main: efd24f8d840e8da5393585b13299e758883dc1a7, tree exactly matching the reviewed pre-merge head. All applicable post-merge checks completed successfully: Test 41318648659 and Platform 41318648477, including Linux 3.10–3.13, required Chromium, all Windows shards and macOS. Scheduled/manual nightly acceptance was event-skipped, not claimed as executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions