Skip to content

Latest commit

 

History

History
81 lines (61 loc) · 3.49 KB

File metadata and controls

81 lines (61 loc) · 3.49 KB

测试与安全验收

常规验证顺序

dotnet restore CodexCliPlus.sln --locked-mode
dotnet build CodexCliPlus.sln --configuration Release --no-restore
dotnet test tests\CodexCliPlus.Tests\CodexCliPlus.Tests.csproj --configuration Release --no-build --filter "Category!=LiveBackend&Category!=Smoke"
dotnet csharpier check src tests

PR CI 默认排除 LiveBackendSmoke 分类。它们需要真实后端进程、端口和桌面/系统环境,由 Backend Integration 的 nightly/manual workflow 承担。

WebUI 验证

Push-Location resources\webui\upstream\source
npm run lint
npm run type-check
npm run test
npm run build
npm run knip:strict
Pop-Location

依赖变更后使用锁文件刷新流程更新 package-lock.json,常规验证使用 npm ci

SafeSmoke

tests/CodexCliPlus.Tests/Smoke/SafeSmoke.ps1 是桌面 smoke 的安全入口。默认模式只做静态检查,不启动桌面进程:

powershell -ExecutionPolicy Bypass -File tests\CodexCliPlus.Tests\Smoke\SafeSmoke.ps1

需要启动 smoke 时,必须指向当前发布输出中的 CodexCliPlus.exe,并使用隔离根目录:

powershell -ExecutionPolicy Bypass -File tests\CodexCliPlus.Tests\Smoke\SafeSmoke.ps1 `
  -Launch `
  -AppPath "$PWD\artifacts\buildtool\publish\win-x64\CodexCliPlus.exe" `
  -RemoveSmokeRoot

脚本只允许启动 CodexCliPlus.exe,并只清理本次启动进程及其隔离 smoke 根目录下的 ccp-core.exe 子进程。

发布与包验证

发布或打包相关改动追加:

dotnet run --project src\CodexCliPlus.BuildTool\CodexCliPlus.BuildTool.csproj -- fetch-assets
dotnet run --project src\CodexCliPlus.BuildTool\CodexCliPlus.BuildTool.csproj -- verify-assets
dotnet run --project src\CodexCliPlus.BuildTool\CodexCliPlus.BuildTool.csproj -- build-webui
dotnet run --project src\CodexCliPlus.BuildTool\CodexCliPlus.BuildTool.csproj -- publish
dotnet run --project src\CodexCliPlus.BuildTool\CodexCliPlus.BuildTool.csproj -- package-offline-installer
dotnet run --project src\CodexCliPlus.BuildTool\CodexCliPlus.BuildTool.csproj -- package-update
dotnet run --project src\CodexCliPlus.BuildTool\CodexCliPlus.BuildTool.csproj -- verify-package
dotnet run --project src\CodexCliPlus.BuildTool\CodexCliPlus.BuildTool.csproj -- write-checksums

Release 不依赖发布代码签名证书。包验证只检查安装器、更新包结构和关键可执行文件有效性;公开发布资产完整性由 SHA-256 与 GitHub artifact attestation 覆盖。

包结构至少应包含:

  • CodexCliPlus.exe
  • assets/backend/windows-x64/ccp-core.exe
  • assets/webui/upstream/dist/index.html
  • assets/webui/upstream/sync.json
  • packaging/dependency-precheck.json
  • packaging/update-policy.json
  • packaging/uninstall-cleanup.json
  • CodexCliPlus.Update.<version>.<rid>.zip

安全规则

  • 不要对真实用户配置目录运行启动 smoke;必须隔离 CODEX_HOMEUSERPROFILEHOMETEMPTMP
  • 不要使用 taskkill /IMStop-Process -Name 或按进程名批量结束后端。
  • 不要把旧的 artifacts/publishartifacts/installer 目录当作当前发布证据。
  • 不要删除或重命名 assets/webui/upstream/dist/index.htmlassets/webui/upstream/sync.jsonccp-core.exe 或上游许可证;resources/webui/upstream/dist 是本地生成目录,不应作为源码提交。
  • 完整安装、卸载和更新验收应在 VM、隔离测试用户或一次性环境中执行。