Skip to content

test(launchagent): make the macOS command fixture portable on Linux - #5181

Merged
huangruiteng merged 1 commit into
mainfrom
codex/launchagent-smoke-portability
Sep 27, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/launchagent-smoke-portability

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Full-public CI runs the macOS LaunchAgent fixture on Ubuntu, where GNU stat cannot read the BSD -f%z argument. Give the existing macOS command fixture a narrow byte-count adapter on non-macOS hosts and use its PATH for the real zsh rotation prelude.

The production launcher and retention thresholds are unchanged. The existing open-descriptor rotation, small-log retention, failed-backup protection, status and upgrade assertions all remain.

Validation: the full LaunchAgent smoke passes on native macOS and through the non-macOS fixture branch; Ruff and diff hygiene pass. Actual Ubuntu CI readback follows on this exact branch.

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Reviewed exact head: 5181@68eea26d00634246c4a8f2d5ffc12f917620e125.

动机

Ubuntu 完整 public-smoke CI 在 macOS LaunchAgent 夹具中调用 BSD stat -f%z;GNU stat 不支持该参数,导致日志轮转断言失败。

改动思路

只修现有测试夹具:macOS 继续使用真实 BSD stat;其他平台用实际文件的 os.stat 适配这一种 byte-count 调用。三个 zsh prelude 调用复用同一 fixture PATH。

具体改动

单文件30行新增、7行删除。真实 zsh、cp、原打开 descriptor、原字节断言、失败备份保护和小日志保留全部继续执行。完整 smoke 在原生 macOS 和非 macOS 夹具分支通过;Ruff、diff hygiene、公开边界通过。当地非 macOS 分支运行不等同实际 Ubuntu,最终发布 CI 将单独读回。

对主干的风险

仅测试环境适配;生产脚本、阈值、安装 plist、状态与恢复权限没有改变,无需前端或 Lark companion。没有新协议、默认行为、typed 状态规则或强制义务。真正的轮转失败仍由原断言发现,没有扩大 mock 到文件副作用。

我的整体评价

这是一处必要的 CI 修复;保留原有覆盖,复用现有 smoke 并压缩重复 subprocess 调用。符合仓库低风险测试 PR 自合并范围,发布仍等待最终源完整 CI 与安装读回。

English verdict: APPROVE - 68eea26; existing native and non-macOS fixture smokes pass, production launcher unchanged; final-release CI remains separately pending.

@huangruiteng
huangruiteng merged commit fce1a4b into main Sep 27, 2026
27 of 28 checks passed
@huangruiteng
huangruiteng deleted the codex/launchagent-smoke-portability branch September 27, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant