Fix integration test binlogs not captured in CI artifacts#34743
Merged
Fix integration test binlogs not captured in CI artifacts#34743
Conversation
When AOTTemplateTest passes a relative binlog path (e.g. 'publish-xxx.binlog') to DotnetInternal.Build, MSBuild resolves it relative to the process CWD instead of the project/test directory. The TearDown in BaseBuildTest copies *.binlog files from TestDirectory to the artifact publish location, but never finds these binlogs since they were written to CWD. Fix: resolve relative binlog paths to the project directory in ConstructBuildArgs, matching the existing auto-generated path behavior (line 43). This ensures binlogs land in TestDirectory where CopyLogsToPublishDirectory will find and publish them. Affects: AOTTemplateTest.PublishNativeAOT, PublishNativeAOTRootAllMauiAssemblies and any other callers passing relative binlog paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34743Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34743" |
rolfbjarne
previously approved these changes
Mar 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to ensure integration-test MSBuild publish/build binlogs are written into the test/project directory so they’re reliably copied into CI artifacts (fixing missing binlogs in published “Logs - Integration Tests …” artifacts).
Changes:
- Resolve caller-provided relative
binlogPathvalues to the directory containing theprojectFileinDotnetInternal.ConstructBuildArgs. - Keep existing behavior for auto-generated binlog names and already-rooted paths.
src/TestUtils/src/Microsoft.Maui.IntegrationTests/Utilities/DotnetInternal.cs
Show resolved
Hide resolved
Pre-resolve the binlog path to the project directory at the call site so both MSBuild (via DotnetInternal.Build) and ReadNativeAOTWarningsFromBinLog use the same absolute path. Without this, passing tests would hit a FileNotFoundException when ReadNativeAOTWarningsFromBinLog tries to read the binlog from CWD while MSBuild wrote it to the project directory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Mar 31, 2026
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
NativeAOT integration test publish binlogs are not being captured in CI artifacts, making it impossible to diagnose build failures like the
MauiPlatformInterop.frameworkstrip/dsymutil errors (tracked in dotnet/macios#24949).Problem
AOTTemplateTestpasses a relative binlog path (e.g."publish-xxx.binlog") toDotnetInternal.Build. SinceDotnetInternal.RunForOutputdoes not set aWorkingDirectory, MSBuild resolves the relative path to the process CWD — not the test project directory (TestDirectory).The
BaseBuildTest.CopyLogsToPublishDirectory()TearDown copies*.binlogfiles fromTestDirectoryto the artifact publish location. Since the binlog was written to CWD, it is never found and never published.Result: The
"Logs - Integration Tests mac_aot_tests"artifact contains only infrastructure binlogs (workload install) and.txtfiles — no publish binlogs for failing tests.Fix
In
DotnetInternal.ConstructBuildArgs, when a caller provides a relativebinlogPath, resolve it to the project directory — matching the existing auto-generated binlog path behavior (samePath.Combine(Path.GetDirectoryName(projectFile), ...)pattern already on line 43).This ensures:
TestDirectory(where the project lives)CopyLogsToPublishDirectory()finds it during TearDownAffected tests
AOTTemplateTest.PublishNativeAOT(9 test cases)AOTTemplateTest.PublishNativeAOTRootAllMauiAssemblies(9 test cases)Testing
The change is 6 lines using
Path.IsPathRooted+Path.Combine— the same pattern already used for auto-generated paths. CI will validate compilation. The artifact capture can be verified on the next AOT integration test run by checking thatpublish-*.binlogfiles appear in the"Logs - Integration Tests mac_aot_tests"artifact.