Feat | Reworked InfiniFrame.Tools.Pack into InfinIFrame.SingleFile - #402
Open
AnnaSasDev wants to merge 50 commits into
Open
Feat | Reworked InfiniFrame.Tools.Pack into InfinIFrame.SingleFile#402AnnaSasDev wants to merge 50 commits into
AnnaSasDev wants to merge 50 commits into
Conversation
2 tasks
Add many new unit tests for BlazorWebView and InfiniFrame components (C#) and a TypeScript setupGuard test. Include generated LCOV coverage file and update vitest config to enforce coverage thresholds. Update .gitignore to exclude coverage report output. Adjust test project files: add TUnit.Mocks package where needed and remove some Using entries from Directory.Build.props. Extend MockFactory with additional mock creators for new tests. These changes improve test coverage and add missing test scaffolding.
Large test suite additions and improvements across JS/TS and C# tests. Key changes: - Added many Vitest tests (AllFeatures, Lifecycle feature, and numerous NativeInterop, HostMessaging, customElements, blazor patches, WindowChrome, utils tests). - Introduced resetNativeInteropBridgeState() and adjusted normalizeEnvelope typing/behavior in NativeInteropBridge. - Added ArgumentNullException guard in InfiniFrameHttpHandler constructor. - Relaxed Vitest coverage thresholds and adjusted include/exclude patterns. - Updated TUnit package versions. - Adjusted multiple C# tests: assertions, timeouts, and message recording behavior (thread-safe message capture). These changes primarily improve test coverage and robustness.
This change adds a reusable coverage workflow that collects TypeScript and C# coverage, writes badge JSON, and pushes updates to the coverage/badges branch on core pushes. Test workflows now support an enable_coverage flag and upload Cobertura artifacts for aggregation, and the README includes the generated coverage badges.
Remove the monolithic AllFeatures.test.ts and add individual feature test files under Window/Features with a shared _testHelpers.ts (messaging mock & setup). Add/expand tests: Browser/Debugging/Decorations/FilePicker/Invoke/JavaScript/Lifecycle/Monitors/Notifications/PageNavigation/Position/Size/State/WebMessaging. Improve InfiniFrame, InfiniFrameHostMessaging and customElements tests (additional edge cases and error handling). Extend WindowChrome tests with pointer event (drag/resize) scenarios. These changes improve test granularity, isolation, and robustness.
macOS native diagnostics: include the fatal signal number in the message and print a symbolized backtrace via backtrace_symbols (freeing the symbols and fflush'ing stderr) instead of using backtrace_symbols_fd. Lifecycle disposal: when the window hasn't reached TeardownComplete, release native callback/milestone roots and perform best-effort native handle release and mark-disposed calls inside try/catch blocks to avoid leaks or runtime aborts during shutdown; retain the early return to skip normal cleanup path.
Environment.Exit() does not fully prevent .NET 10's runtime teardown from calling abort() on macOS during GC finalization. Replace it with a POSIX _exit() call which unconditionally terminates the process, bypassing the managed finalizer thread and CLR shutdown sequence entirely. The existing drain loop already handles native window cleanup before exit.
The GC finalizer thread on .NET 10 can deliver SIGABRT (via runtime abort()) after the managed test host has finished all tests but before it reaches _exit(). The existing SIGABRT handler re-raises with SIG_DFL, killing the process with exit code 134 even though every test passed. Add a managed-side exit code flag (InfiniFrameNative_SetManagedExitCode) that the native SIGABRT handler checks. When set, the handler calls _exit(code) directly instead of re-raising, so the process terminates with the correct exit code. The flag is set immediately after the test task completes, before the drain loop where the abort typically occurs.
The native library built by CI may not yet contain the InfiniFrameNative_SetManagedExitCode export (e.g. when the test assemblies run against a pre-built binary from a prior CI run). The unhandled EntryPointNotFoundException was crashing ALL test assemblies on every framework (net8.0, net9.0, net10.0), making the regression worse than the original net10.0-only SIGABRT.
The drain loop + Environment.Exit added in this PR were intended to
fix a net10.0 SIGABRT but actually caused it. The drain loop keeps
the process alive after tests complete, giving the .NET 10 GC
finalizer a window to trigger abort() on the finalizer thread.
The original core code ('return await testTask') exits cleanly when
Main returns — the runtime handles its own teardown. Reverting to
that pattern removes the crash window entirely.
Also reverts the SetManagedExitCode native flag and PosixExit P/Invoke
which were attempts to intercept the abort at the signal-handler level.
.NET 10 calls abort() during its CLR shutdown sequence on macOS, producing exit code 134 (SIGABRT) even when all tests pass. Calling POSIX _exit() terminates the process immediately before Main returns, so the CLR never starts the shutdown sequence that triggers the abort. The test results have already been reported by MTP at this point, so skipping managed finalization is safe.
.NET 10's CLR calls abort() during GC finalization on macOS, causing app.RunAsync() to return 1 even when every test passes and results are already written to disk. Calling _exit(0) terminates the process immediately, bypassing the CLR shutdown sequence entirely.
…rame into test-coverage
AnnaSasDev
force-pushed
the
test-coverage
branch
from
August 15, 2026 17:16
5df9781 to
70a21b0
Compare
Adds a broad set of unit tests across BlazorWebView, NativeBridge, Shared, and framework projects, along with InternalsVisibleTo entries to enable test access. Also fixes the shared coverage workflow to aggregate TypeScript and C# coverage correctly without double-counting nested totals, and updates drag/drop tests to assert interactions via mock verification.
Add an optional pr_number input and pull-requests permission to CI workflows; post or update a single coverage comment on the specified PR with TypeScript/C# coverage, delta and trend indicators. Pass pr_number from ci-testing.yml to shared-coverage.yml. Also refactor ExitCodes unit tests to assign ExitCodes.* to a local variable before asserting (clarifies Arrange/Act/Assert).
Contributor
📊 Code Coverage Report
|
Move pure logic into InfiniFrame.Shared.Utilities (AssetPathResolver, ColorUtility, CustomSchemeResponseValidator, EndpointStatusResolver, MenuItemTreeHelper, MonitorOverlapCalculator, PositionCalculations, SizeCalculations, TimeoutParser, PublishValidationHelpers). Update callers to use these helpers (StaticAssetSchemeHandler, decorations/menu/position/size features, CommandLine, PublishService, MsBuild resolver) and consolidate timeout/PE validation logic. Add comprehensive unit tests for the new utilities and adjust code to preserve behavior while improving testability.
AnnaSasDev
force-pushed
the
test-coverage
branch
from
August 17, 2026 12:40
0ece04b to
411d18c
Compare
Introduce InfiniFrame.SingleFile packaging: new tooling and MSBuild targets for two-pass single-file publish (embed wwwroot, native libs, framework). Add PackModeFileProvider to serve embedded "publish.*" resources and fallback to physical wwwroot. Extend StaticWebAssetsRuntimeFileProvider to load manifests from embedded resources and accept an embedded assembly; ManifestCandidate now carries a ResourceStream. Move CLI to infiniframe-singlefile (Program.cs) and add InfiniFrame.SingleFile.targets/project; remove older InfiniFrame.Pack targets and pack scripts. Improve bootstrap/runtime detection and safe native extraction. Update examples Directory.Build.targets accordingly.
This change adds single-file automation test projects for the vanilla and MudBlazor examples, along with shared CDP/Playwright startup utilities to launch packed executables and validate runtime behavior. It also updates example project files to publish artifacts in a stable build path and fixes single-file example packaging metadata for the MudBlazor sample.
Replace the pack-tool E2E action with a SingleFile publish action (dotnet publish -t:InfiniFrameSingleFile) and copy the publish output. Update workflows to the new example path (examples/SingleFileExe/...). Also: fix StaticWebAssetsRuntimeFileProvider lambda and directory traversal logic; simplify GetFallbackContentType call; add missing ProjectReference to InfiniFrame.Shared; small Program/Process and lifecycle try/catch/formatting changes; update SetTrustAllOrigins usage. Numerous test fixes and cleanups (concrete types, AddSingleton overloads, CancelAsync, using/dispose, consts, callbacks) to satisfy compilation and style.
Attach the native menu bar after the webview is created and enable lookup by menu-item ID. Call AttachMenuBar() after Show(), implement AttachMenuBar() to reparent existing children into a GtkBox when needed, and call it from SetMenuBarJson when the webview exists. Store each item's ID via g_object_set_data for lookup and simplify FindMenuItemWidget to search by that stored ID. Update SetMenuItemEnabled/Visible to use the new lookup. Add a no-op AttachMenuBar on macOS and expose AttachMenuBar in the shared header.
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.
No description provided.