test: Comprehensive unit tests for Sub Issue 13 (Client/Upgrade/Differential/Push/Parameter matrix)#391
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a comprehensive set of new unit/integration tests across Core, ClientCore, and Differential test projects to cover Sub Issue 13 of the refactoring plan (mutual upgrade flows, differential pipeline scenarios, push/event notifications, and parameter matrix validation).
Changes:
- Introduces new integration-style tests for differential Clean/Dirty flows, including binary/large-file and pipeline progress/cancellation scenarios.
- Adds Core tests for EventManager dispatch/listener behavior, Configinfo validation matrices, blacklist variations, and StorageManager backup behavior.
- Adds developer-scenario tests for bootstrap configuration in both Core (GeneralUpdateBootstrap) and ClientCore (GeneralClientBootstrap).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| tests/DifferentialTest/DifferentialUpgradeIntegrationTests.cs | New end-to-end differential upgrade tests covering Clean/Dirty, binary/large file diffs, pipeline progress/cancellation, and edge cases. |
| tests/CoreTest/Bootstrap/ParameterMatrixAndEventTests.cs | New parameter matrix + EventManager pipeline tests plus StorageManager backup scenarios. |
| tests/CoreTest/Bootstrap/ClientUpgradeIntegrationTests.cs | New Core bootstrap integration tests for mutual-upgrade configuration and ProcessInfo/VersionInfo serialization scenarios. |
| tests/ClientCoreTest/Bootstrap/ClientBootstrapScenarioTests.cs | New ClientCore bootstrap scenario tests for fluent configuration, listeners, precheck/skip, and config edge cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+23
to
+27
| /// - Client ??Upgrade mesh update: generate patches in client context, apply in upgrade context | ||
| /// - All file operations: modified, added, deleted, unchanged, binary | ||
| /// - Complex directory structures | ||
| /// - Push upgrade simulation via differential pipeline | ||
| /// - Various parameter combinations (parallel, serial, cancellation, progress) |
| // Act ??Step 2: Upgrade applies patches (Dirty) | ||
| await DifferentialCore.Dirty(appDir, patchDir); | ||
|
|
||
| // Assert �� core files should still exist after Dirty |
Comment on lines
+268
to
+277
| var manager = BlackListManager.Instance; | ||
|
|
||
| manager.AddBlackFiles(new List<string> { "*.pdb", "*.xml" }); | ||
| manager.AddBlackFileFormats(new List<string> { ".log", ".cache" }); | ||
| manager.AddSkipDirectorys(new List<string> { "logs", "temp_directory" }); | ||
|
|
||
| Assert.NotNull(manager.BlackFiles); | ||
| Assert.NotNull(manager.BlackFileFormats); | ||
| Assert.NotNull(manager.SkipDirectorys); | ||
| } |
Comment on lines
+18
to
+21
| /// Comprehensive integration tests for Client �?Upgrade mutual upgrade process. | ||
| /// Tests the full lifecycle: Client validates versions, downloads packages, | ||
| /// passes ProcessInfo to Upgrade, and Upgrade applies updates. | ||
| /// |
Comment on lines
+115
to
+139
| [Fact] | ||
| public void ClientUpgrade_ForciblyUpdate_SkipCallbackIsIgnored() | ||
| { | ||
| var config = new Configinfo | ||
| { | ||
| UpdateUrl = "https://api.example.com/updates", | ||
| MainAppName = "MyApp.exe", | ||
| ClientVersion = "1.0.0", | ||
| InstallPath = _testBaseDir, | ||
| AppSecretKey = "test-key", | ||
| Scheme = "https", | ||
| Token = "test-token" | ||
| }; | ||
|
|
||
| var skipCalled = false; | ||
| var bootstrap = new GeneralUpdateBootstrap() | ||
| .SetConfig(config) | ||
| .SetCustomSkipOption(() => | ||
| { | ||
| skipCalled = true; | ||
| return true; | ||
| }); | ||
|
|
||
| Assert.NotNull(bootstrap); | ||
| } |
Comment on lines
+86
to
+89
| // Assert �?all components configured correctly | ||
| Assert.NotNull(bootstrap); | ||
| Assert.Same(bootstrap, bootstrap); | ||
| } |
Comment on lines
+17
to
+21
| /// <summary> | ||
| /// Comprehensive ClientBootstrap scenario tests. | ||
| /// Covers real-world developer usage patterns: | ||
| /// - Client �?Upgrade mutual upgrade configuration | ||
| /// - Version precheck / skip scenarios |
Add comprehensive unit tests covering: - Client/Upgrade mutual upgrade integration (ProcessInfo IPC, version chain, forcibly update) - Differential upgrade full cycle (Clean/Dirty, binary files, nested directories, mixed operations) - Event notification pipeline (all 7 event types, push upgrade simulation, multiple listeners) - Parameter matrix combinations (UpdateOptions, Configinfo validation, auth schemes, blacklists) - Real-world developer usage scenarios (minimal setup, full production chain, fluent API) - StorageManager backup/restore tests - PipelineContext and DiffPipeline tests Results: CoreTest 111/112 pass, DifferentialTest 23/23 pass, ClientCoreTest 115/115 pass
- Rebase on origin/master (merged project structure) - Fix all namespace references to GeneralUpdate.Core.* - Fix API changes: AppType enum, UpdateOptions, BlackListManager - Fix copilot suggestions: encoding, tautology, mutations, unused vars - Fix AddCustomOption empty list and Precheck callback tests Results: CoreTest 165p, DifferentialTest 85p, ClientCoreTest 42p
d73f5ad to
7874712
Compare
JusterZhu
added a commit
that referenced
this pull request
May 24, 2026
…x, config models) (#392) * test: add missing coverage tests (post-#391 follow-up) Files that missed the #391 squash merge: - BootstrapFullParameterMatrixTests: ALL 42 UpdateOptions, 6 chains including Client+Upgrade dual full-configuration - BootstrapHooksAndExtensionsTests: IUpdateHooks lifecycle (5 methods), IUpdateReporter, IUpdateEventListener (8 events), security schemes - ConfigurationModelsTests: BlackListConfig, HubConfig, DownloadAsset/Plan/ Progress/Result, 9 enums, UpdateOption<T> semantics Closes #390 (follow-up) * fix: copilot suggestions - remove OnCustomEvent, fix option counts, drop region counts - Remove OnCustomEvent from TestEventListener (only 7 IUpdateEventListener methods exist) - Fix file header: 42 options -> 37 options (matches actual UpdateOptions surface) - Remove hard-coded test counts from #region headers to prevent drift - Fix garbled characters in comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #390
Comprehensive unit tests for Sub Issue 13 of the GeneralUpdate refactoring plan.
Changes
4 new test files (2669 lines)
ClientUpgradeIntegrationTests.cs(CoreTest)ParameterMatrixAndEventTests.cs(CoreTest)DifferentialUpgradeIntegrationTests.cs(DifferentialTest)ClientBootstrapScenarioTests.cs(ClientCoreTest)Test Results
The 1 pre-existing failure in CoreTest (
ConfiginfoBuilderTests.Build_InitializesCollectionProperties) is unrelated and exists on master.