.2059806565729300:5a47531e9b15134c7667e7e10eda67f2_69e3499ab13256d09ece8088.69e4b19cb13256d09ece844d.69e4b19c7afba9383018b93c:Trae CN.T(2026/4/19 18:42:36)#1276
Conversation
重构集成测试脚本,增加健康检查轮询机制替代固定等待时间 添加详细的测试帮助文档和环境变量配置说明 改进日志记录和错误检测功能
添加全局和单测超时控制,改进错误分类和诊断信息 添加 pytest-timeout 依赖,支持进程树清理 优化日志输出和错误处理流程
添加 GitHub Actions 集成测试工作流,支持通过输入参数跳过构建步骤直接下载二进制文件 设置全局测试超时和分步超时控制 支持多平台(ubuntu/macos)测试环境
在构建流程中添加 doctor 检查步骤,确保环境依赖正确 新增严格模式验证脚本,检查打包内容和版本一致性 优化构建日志输出,增加详细步骤和错误处理
| import json | ||
| import signal | ||
| import atexit | ||
| import sys |
|
|
||
|
|
||
| GLOBAL_SERVER_PROCESS: Optional['ServerProcess'] = None | ||
| GLOBAL_TEST_TIMEOUT: int = 120 |
| for child in children: | ||
| try: | ||
| child.kill() | ||
| except psutil.NoSuchProcess: |
|
|
||
| try: | ||
| parent.kill() | ||
| except psutil.NoSuchProcess: |
| for p in still_alive: | ||
| try: | ||
| p.kill() | ||
| except psutil.NoSuchProcess: |
| p.kill() | ||
| except psutil.NoSuchProcess: | ||
| pass | ||
| except psutil.NoSuchProcess: |
| else: | ||
| try: | ||
| os.killpg(os.getpgid(pid), signal.SIGKILL) | ||
| except ProcessLookupError: |
| except OSError: | ||
| try: | ||
| os.kill(pid, signal.SIGKILL) | ||
| except ProcessLookupError: |
|
|
||
| start_time = time.time() | ||
| poll_count = 0 | ||
| last_exit_check = 0 |
| if path and os.path.exists(path): | ||
| try: | ||
| os.remove(path) | ||
| except Exception: |
Greptile SummaryThis PR adds environment pre-checks (
Confidence Score: 3/5Merge blocked by a correctness bug in verify-package.sh that silently bypasses the intended exit-code contract in strict CI mode. One P1 bug in
Important Files Changed
Reviews (1): Last reviewed commit: "ci(build): 添加构建前的环境检查和严格模式验证" | Re-trigger Greptile |
| # 2: Verification failed (only with --strict) | ||
| # | ||
|
|
||
| set -euo pipefail |
There was a problem hiding this comment.
set -euo pipefail causes premature exit before summary is printed
set -euo pipefail at line 28 means any function that returns non-zero exits the script immediately. Several callers in main() invoke check_critical_executables, check_critical_directories, etc. without wrapping them in if or || true. If check_critical_executables hits its early-return path (line 208–210, when dist/activitywatch is missing), Bash exits with code 1 before the summary block or the intended exit-code logic (exit 2 for strict mode) is ever reached. The documented exit-code contract—"0 when not --strict" and "2 on failure with --strict"—is silently violated.
Fix by either removing set -e (and checking return values manually), or guard every top-level check call:
check_critical_executables || true
check_critical_directories || true
check_artifacts || true
check_version_consistency || true|
|
||
|
|
||
| GLOBAL_SERVER_PROCESS: Optional['ServerProcess'] = None | ||
| GLOBAL_TEST_TIMEOUT: int = 120 |
There was a problem hiding this comment.
GLOBAL_TEST_TIMEOUT is defined but never read
GLOBAL_TEST_TIMEOUT = 120 is set as a module-level constant but no code path reads it; the actual timeout is sourced from ServerConfig.test_timeout via the AW_TEST_TIMEOUT environment variable. The unused variable is misleading—it suggests a global timeout is being enforced when it isn't.
| return False | ||
|
|
||
| def check_for_errors(self) -> Tuple[bool, List[str]]: | ||
| error_indicators = ["ERROR", "panic", "thread '", "stack backtrace", "fatal", "Error:"] |
There was a problem hiding this comment.
Overly broad error indicators may produce false positives
check_for_errors scans logs for "thread '", "Error:", and "fatal" as error signals. Rust binaries routinely emit thread 'main' at startup in normal output, and the server may legitimately log URLs containing Error. These indicators could cause test_no_error_indicators_in_logs to fail spuriously on valid server output. Consider anchoring patterns to known bad prefixes (e.g., ERROR: for Python logging, RUST_BACKTRACE style panics) or filtering out known-good lines.
| uses: dtolnay/rust-toolchain@master | ||
| with: |
There was a problem hiding this comment.
Floating
@master reference for dtolnay/rust-toolchain
uses: dtolnay/rust-toolchain@master resolves to whatever the action's master branch points to at run time. A breaking update to that action would silently fail all integration jobs that build from source. Pin to a commit SHA or a stable tag to ensure reproducibility.
|
@Wpc-121 Please stop spamming PRs with weird names! |
添加构建前的环境检查和严格模式验证
在构建流程中添加 doctor 检查步骤,确保环境依赖正确
新增严格模式验证脚本,检查打包内容和版本一致性
优化构建日志输出,增加详细步骤和错误处理