Skip to content

test(starry,nginx): implement alpine app nginx CI#1014

Merged
ZR233 merged 6 commits into
rcore-os:devfrom
Antareske:app/alpine-nginx
Jun 1, 2026
Merged

test(starry,nginx): implement alpine app nginx CI#1014
ZR233 merged 6 commits into
rcore-os:devfrom
Antareske:app/alpine-nginx

Conversation

@Antareske

Copy link
Copy Markdown
Contributor

整理 Nginx 测试

背景

#869 的基础上,把 Nginx 测试从“分散脚本 + 部分 test-suit case 试验接入”收敛为apps 侧统一 CLI 工作流,降低维护成本并避免非 smoke 测试误接入全局测试入口。

另外,这里也一并完成了历史资产归拢:此前 normal 下已有的两个 nginx 相关测例不再继续作为当前主测试入口,现统一归到 apps/starry/nginx 体系中进行维护和迭代。

本次改动

1) 统一测试结构到 apps/starry/nginx

新增并整理四类目录:

  • smoke/:仅保留并接入当前 smoke 测试脚本(CI 入口)
  • phase/:按阶段单元组织测试,命名统一为 x-x 风格(如 nginx-1-3-lifecycle-tests.sh
  • stress/:单独管理压力测试(当前先以说明文档归档)
  • debug/:用于单问题定位与灵活复现实验

2) 统一本地开发 CLI

提供 apps/starry/nginx/nginx-cli-tests.sh,便于本地按 smoke / phase 子命令执行。

说明:该 CLI 主要面向测试迭代,不作为全局 CI 的直接接入点。

3) 明确接入边界

  • 在 tgoskits 全局测试入口中,当前仅接入 nginx smoke。
  • phase / stress / debug 现不接入全局测试,避免阻塞主流程与引入不稳定项。

阶段性推进规划

当前 nginx 测试规划分为三层推进:

  1. Smoke:持续保持唯一接入入口,保证回归效率。
  2. Phase:按阶段测试语义推进。
  3. Stress/Debug
    • stress:集中做并发与压力特性验证,不影响主回归链路;
    • debug:围绕单问题做最小复现与定位(如多 worker 卡死、异常请求路径不稳定等)。

@Antareske

Copy link
Copy Markdown
Contributor Author

已回退fix(starry,nginx): fix multi-worker signal/epoll lifecycle and add debug regressions并另开分支提交。本 pr 仅是 nginx CI 实现。

@mai-team-app mai-team-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review 摘要

改动内容:将 nginx 测试从 test-suit/starryos/normal/qemu-smp1/nginx-smoke/ 迁移到 apps/starry/nginx/,统一为 apps 侧 CLI 工作流。新增 build configs(x86_64 + riscv64)、prebuild.sh、mirror helper、phase/debug/stress 目录结构,删除旧 test-suit 下的 nginx-smoke。smoke 前缀从 STARRY_NGINX_* 统一改为 NGINX_APP_*


🚫 阻塞问题:build configs 使用了不存在的 feature ax-driver/pci

两个 build config(build-x86_64-unknown-none.tomlbuild-riscv64gc-unknown-none-elf.toml)都声明了 ax-driver/pci feature,但 ax-driver crate 当前 没有 pci feature。实际执行 cargo xtask starry app run -t nginx --arch x86_64 的输出:

error: failed to select a version for `ax-driver`.
  package `starryos` depends on `ax-driver` with feature `pci` but `ax-driver` does not have that feature.
  help: there is a feature `ahci` with a similar name

参考 test-suit/starryos/normal/qemu-smp1/build-x86_64-unknown-none.toml,正确的 feature 应为 ax-driver/plat-static(x86_64)而非 ax-driver/pci。riscv64 同理,dev 分支上 test-suit/starryos/normal/qemu-smp1/build-riscv64gc-unknown-none-elf.toml 使用的是 ax-feat/rtc + ax-driver/rtc + ax-driver/serial + ax-driver/virtio-* 组合,plat_dyn = true,与本 PR 使用的 feature 集有显著差异。

注意ax-driver/pci 问题也是 apps/starry/gdb-smoke 的已知遗留问题,但 nginx build config 是本 PR 新增的,需要在本 PR 中修正。

建议:将 ax-driver/pci 替换为 ax-driver/plat-static(x86_64),riscv64 侧参照 dev 分支上 test-suit/starryos/normal/qemu-smp1/build-riscv64gc-unknown-none-elf.toml 的 feature 集重新对齐。


QEMU 验证结果

因 build config 中 feature 错误,cargo xtask starry app run -t nginx --arch x86_64 在编译阶段即失败,无法进入 QEMU 运行。验证结论:失败(编译阶段阻塞)。


CI 状态

所有 GitHub Actions check run 的 conclusion 均为 skipped,没有任何 test 实际执行。


重复/重叠分析

  • dev 分支上 test-suit/starryos/normal/qemu-smp1/nginx-smoke/ 已被本 PR 删除并迁移到 apps/starry/nginx/,这是正确的。
  • dev 分支上 test-suit/starryos/normal/qemu-smp1/bugfix/bug-nginx-fioasync/bug-nginx-fionread-socket/ 未受影响,保持独立。
  • 搜索到的开放 PR(#1016 work-stealing、#1017 apk cmake)与本 PR 无重叠。
  • 无重复或冲突风险。

其他观察

  • 测试目录结构(smoke/phase/stress/debug)组织合理,仅 smoke 接入 CI 入口。
  • prebuild.sh 正确将 smoke 测试脚本和 mirror helper 注入 guest overlay。
  • smoke 脚本从旧版 507 行压缩到 285 行,主要去掉了冗余空行和多行函数声明,核心逻辑保持一致。
  • nginx-alpine-mirror.sh 封装了 apk mirror fallback 逻辑,被 smoke 和 debug 脚本共享。
  • nginx-cli-tests.sh 提供了本地开发的 CLI 入口。

结论

构建配置中 ax-driver/pci feature 不存在导致编译失败,无法验证 QEMU 运行。请修正 build configs 中的 feature 后重新验证 cargo xtask starry app run -t nginx --arch x86_64--arch riscv64 是否可以通过编译并进入 QEMU 运行 smoke 测试。

Powered by mimo-v2.5-pro

log = "Warn"
features = [
"ax-hal/x86-pc",
"qemu",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ax-driver crate 当前没有 pci feature(可通过 cargo metadata 确认)。此处应为 ax-driver/plat-static,参照 test-suit/starryos/normal/qemu-smp1/build-x86_64-unknown-none.toml

另外,riscv64 侧的 feature 集也需要参照 dev 分支上的 test-suit 共享 build config 重新对齐(注意 dev 分支上 riscv64 使用 ax-feat/rtc + ax-driver/rtc + ax-driver/serial + plat_dyn = true,而非 ax-hal/riscv64-qemu-virt + ax-driver/pci + plat_dyn = false)。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

已修改

log = "Warn"
features = [
"ax-hal/riscv64-qemu-virt",
"qemu",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

同上,ax-driver/pci feature 不存在。请参照 test-suit/starryos/normal/qemu-smp1/build-riscv64gc-unknown-none-elf.toml 的 feature 集修正。当前 dev 分支上 riscv64 的正确组合为:ax-feat/rtcax-driver/rtcax-driver/serialax-driver/virtio-*starry-kernel/inputplat_dyn = true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

已修改

@mai-team-app
mai-team-app Bot requested review from ZCShou and luodeb May 28, 2026 14:54

@mai-team-app mai-team-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

APPROVE

上次审查的 ax-driver/pci feature 问题已修复。两个 build config 现在使用正确的 feature 集。

QEMU 验证:x86_64 和 riscv64 均通过 cargo xtask starry app run -t nginx,全部 21 个 smoke 步骤通过,输出 NGINX_APP_SMOKE_PASSEDcargo fmt --check 通过。

CI:无 PR 导致的失败。

重复分析:旧 test-suit/starryos/normal/qemu-smp1/nginx-smoke/ 已正确迁移。PR #1018(多 worker 内核 fix)与本 PR 互补,不冲突。

结构:smoke/phase/stress/debug 目录组织合理,仅 smoke 接入 CI。prebuild.sh、nginx-alpine-mirror.sh、qemu-*.toml 配置正确。

无阻塞问题。

Powered by mimo-v2.5-pro

@ZR233
ZR233 merged commit a3d9b09 into rcore-os:dev Jun 1, 2026
86 of 94 checks passed
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.

2 participants