Skip to content

feat: simplify ClientTest/UpgradeTest for chain and cross-version integration testing#507

Merged
JusterZhu merged 2 commits into
masterfrom
feat/integration-test-client-upgrade
Jun 11, 2026
Merged

feat: simplify ClientTest/UpgradeTest for chain and cross-version integration testing#507
JusterZhu merged 2 commits into
masterfrom
feat/integration-test-client-upgrade

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

关联 Issue

Closes #506

改动内容

  1. ClientTest — 精简为单一入口,去掉 OSS/silent 模式注释代码,支持链式和跨版本两种测试场景(由 Core.DownloadPlanBuilder 自动决策)
  2. UpgradeTest — 优化日志和 IPC 流程说明
  3. ClientTest.csproj — 修复 MSBuild target 排除 *.json 导致 Update.exe 启动失败的问题

如何验证

# 1. 启动 GeneralSpacestation(需要 MySQL 种子数据)
cd GeneralSpacestation/src/GeneralSpacestation
dotnet run

# 2. 跑 ClientTest
cd GeneralUpdate/tests/ClientTest
dotnet build
./bin/Debug/net10.0/ClientTest.exe

测试结果

  • 链式更新:Client v1.0.0 → v1.2.0(经过 1.1.0 → 1.2.0 两条链式补丁),Upgrade v2.0.0.0 → v2.1.0.0
  • 跨版本更新:CrossVersionUpgrade.IsEnabled=true 时,DownloadPlanBuilder 优先选择 CVP(FromVersion 匹配则一跳到位)

…egration testing

- Replace OSS/deprecated silent mode with a single mode-agnostic ClientTest entry point
- Remove CLI argument branching (chain/cross-version); the SDK's DownloadPlanBuilder
  selects CVP vs chain automatically based on server response (IsCrossVersion + FromVersion)
- Fix MSBuild CopyUpgradeTest target: stop excluding *.json so UpgradeTest.runtimeconfig.json
  is bundled as Update.exe, fixing 'hostpolicy.dll not found' launch error
- Improve events logging (IsCrossVersion/AppType/FromVersion display in OnUpdateInfo)
- Update UpgradeTest with clearer IPC flow documentation

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 11, 2026 07:28

Copilot AI 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.

Pull request overview

This PR streamlines the two-process integration test harness (Client → Upgrade) used to validate both chain-update and cross-version (CVP) flows against GeneralSpacestation, and fixes a build output copy issue that prevented Update.exe from starting correctly.

Changes:

  • Simplified ClientTest into a single mode-agnostic entry point, relying on Core.DownloadPlanBuilder to choose chain vs CVP.
  • Simplified UpgradeTest to always run the standard IPC-driven upgrade path, with clearer IPC/logging notes.
  • Fixed ClientTest.csproj output-copy target to include required *.json files from UpgradeTest output.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
tests/UpgradeTest/Program.cs Removes OSS-mode path and improves IPC/logging explanations for the standard upgrade flow.
tests/ClientTest/Program.cs Consolidates test entry point and enhances update-info logging for chain/CVP visibility.
tests/ClientTest/ClientTest.csproj Stops excluding *.json so Update.exe has required runtime/deps config files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/UpgradeTest/Program.cs Outdated
// When no IPC file exists (first run, no update pending), the bootstrap
// treats it as a no-op and returns gracefully — no error, no crash.
Console.WriteLine("Reading IPC process contract (written by Client process)...");
Console.WriteLine("IPC file: %TEMP%/GeneralUpdate/ipc/process_info.enc");
Comment thread tests/UpgradeTest/Program.cs
Comment thread tests/ClientTest/Program.cs
Comment on lines +125 to +129
var mode = vi.IsCrossVersion == true ? "CVP" : "Chain";
Console.WriteLine($" - [{mode}] {vi.Version} ({vi.Name}) [{vi.Size} bytes] " +
$"AppType={(vi.AppType == 1 ? "Client" : "Upgrade")} " +
$"{(vi.IsForcibly == true ? "(forced)" : "")}" +
$"{(!string.IsNullOrEmpty(vi.FromVersion) ? $" from={vi.FromVersion}" : "")}");
- Replace hard-coded '%TEMP%/...' IPC path with Path.GetTempPath() at runtime
- Use OS-agnostic wording for strategy comments (WindowsStrategy → OS strategy)
- Use switch expression for AppType display to handle null/unknown values
@JusterZhu JusterZhu merged commit ae8eb95 into master Jun 11, 2026
3 checks passed
@JusterZhu JusterZhu deleted the feat/integration-test-client-upgrade branch June 11, 2026 11:37
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.

Integration test harness: ClientTest + UpgradeTest for chain and cross-version update flow

2 participants