test_runner

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Test Runner

测试运行器

Use this skill to execute tests and understand why they might be failing.
使用该Skill来执行测试并理解测试失败的原因。

Inputs

输入

  • Test Command: (Optional) Override defaults (e.g.,
    npm test -- -t "search"
    ).
  • Scope: Specific file or all tests.
  • 测试命令:(可选)覆盖默认命令(例如:
    npm test -- -t "search"
    )。
  • 范围:指定文件或全部测试。

Tooling Strategy

工具策略

  • Use
    run_command
    to execute tests.
  • Use
    view_file
    to read failure logs or source code if tests fail.
  • 使用
    run_command
    执行测试。
  • 如果测试失败,使用
    view_file
    读取失败日志或源代码。

Workflow

工作流程

1. Execution

1. 执行

  • Command: Run the appropriate test command for the environment (e.g.,
    npm test
    ,
    pytest
    ,
    python -m unittest
    ).
  • Scope: Run all tests by default, or target a specific file if requested.
  • 命令:针对运行环境执行合适的测试命令(例如:
    npm test
    pytest
    python -m unittest
    )。
  • 范围:默认运行所有测试,或根据请求针对指定文件运行。

2. Analysis

2. 分析

  • Pass: If all green, celebrate! 🟢
  • Fail: If red 🔴, analyze the output:
    • StackTrace: Where exactly did it blow up?
    • Assertion: What was expected vs. what was received?
    • Diff: Visual comparison of the data mismatch.
  • 通过:如果全部通过,恭喜!🟢
  • 失败:如果失败🔴,分析输出内容:
    • 堆栈跟踪(StackTrace):具体在哪个位置出错?
    • 断言(Assertion):预期结果与实际接收结果有何差异?
    • 差异对比(Diff):数据不匹配的可视化对比。

3. Recommendation

3. 建议

  • If tests failed, provide a summary of the failure.
  • Suggest potential fixes or point to the line of code causing the regression.
  • 如果测试失败,提供失败情况总结。
  • 提出潜在修复方案,或指出导致回归问题的代码行。

4. Integrity

4. 完整性

  • Ensure that the testing process didn't leave behind artifacts (temp files, database entries) unless intended for debugging.
  • 确保测试过程不会留下临时文件、数据库条目等 artifacts(除非是为了调试目的)。