Skip to content

Fix integration test binlogs not captured in CI artifacts#34743

Merged
PureWeen merged 2 commits intonet11.0from
fix/integration-test-binlog-capture
Mar 30, 2026
Merged

Fix integration test binlogs not captured in CI artifacts#34743
PureWeen merged 2 commits intonet11.0from
fix/integration-test-binlog-capture

Conversation

@PureWeen
Copy link
Copy Markdown
Member

Summary

NativeAOT integration test publish binlogs are not being captured in CI artifacts, making it impossible to diagnose build failures like the MauiPlatformInterop.framework strip/dsymutil errors (tracked in dotnet/macios#24949).

Problem

AOTTemplateTest passes a relative binlog path (e.g. "publish-xxx.binlog") to DotnetInternal.Build. Since DotnetInternal.RunForOutput does not set a WorkingDirectory, MSBuild resolves the relative path to the process CWD — not the test project directory (TestDirectory).

The BaseBuildTest.CopyLogsToPublishDirectory() TearDown copies *.binlog files from TestDirectory to 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 .txt files — no publish binlogs for failing tests.

Fix

In DotnetInternal.ConstructBuildArgs, when a caller provides a relative binlogPath, resolve it to the project directory — matching the existing auto-generated binlog path behavior (same Path.Combine(Path.GetDirectoryName(projectFile), ...) pattern already on line 43).

This ensures:

  1. The binlog is written inside TestDirectory (where the project lives)
  2. CopyLogsToPublishDirectory() finds it during TearDown
  3. It appears in the published CI artifact automatically
  4. No changes needed to AOTTemplateTest, pipeline YAML, or BaseBuildTest

Affected tests

  • AOTTemplateTest.PublishNativeAOT (9 test cases)
  • AOTTemplateTest.PublishNativeAOTRootAllMauiAssemblies (9 test cases)
  • Any future callers passing relative binlog paths

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 that publish-*.binlog files appear in the "Logs - Integration Tests mac_aot_tests" artifact.

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>
Copilot AI review requested due to automatic review settings March 30, 2026 16:32
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34743

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34743"

rolfbjarne
rolfbjarne previously approved these changes Mar 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 binlogPath values to the directory containing the projectFile in DotnetInternal.ConstructBuildArgs.
  • Keep existing behavior for auto-generated binlog names and already-rooted paths.

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>
@PureWeen PureWeen merged commit a547677 into net11.0 Mar 30, 2026
33 of 36 checks passed
@PureWeen PureWeen deleted the fix/integration-test-binlog-capture branch March 30, 2026 22:25
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.

3 participants