Skip to content

Apply Integration Tests logging fixes from PR #33624 - #33638

Merged
rmarinho merged 2 commits into
mainfrom
copilot/fix-logging-issues-except-common-targets
Jan 21, 2026
Merged

Apply Integration Tests logging fixes from PR #33624#33638
rmarinho merged 2 commits into
mainfrom
copilot/fix-logging-issues-except-common-targets

Conversation

Copilot AI commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Port logging improvements from #33624 to make Integration Test output visible in CI. Console.WriteLine output is not captured by Azure DevOps; ITestOutputHelper is.

Changes

Utility Classes

  • ToolRunner.cs, DotnetInternal.cs, XHarness.cs - Add optional ITestOutputHelper? output parameter, replace Console.WriteLine with output?.WriteLine()
  • BuildWarningsUtilities.cs - Add OutputBuildErrorsFromBinLog() to extract/display build errors on failure
  • Adb.cs, Emulator.cs, Simulator.cs - Propagate ITestOutputHelper through Android/Apple utilities

Test Files

  • All test files pass output: _output to DotnetInternal.New(), DotnetInternal.Build(), XHarness.Run*() calls

Project

  • Add ShowLiveOutput=true to csproj

Example

// Before
Assert.True(DotnetInternal.Build(projectFile, config, properties: BuildProps),
    $"Project failed to build.");

// After
Assert.True(DotnetInternal.Build(projectFile, config, properties: BuildProps, output: _output),
    $"Project failed to build.");

Excluded: src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets as requested.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ghcr.io
    • Triggering command: /tmp/dependabot-cli/dependabot/dependabot /tmp/dependabot-cli/dependabot/dependabot graph nuget org/repo --local /home/REDACTED/work/maui/maui --branch main --directory src/TestUtils/src/Microsoft.Maui.IntegrationTests --proxy-cert /home/REDACTED/work/_temp/runtime-logs/mkcert/rootCA.pem --updater-env NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/dbot-ca.crt git /bin/test --local credential.helpe/home/dependabot/dependabot-updater/bin/main.ps1 /usr/bin/git basename (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Create apr with all the logging Fixes from this pr #33624 which should be everything except this file src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Update ToolRunner.cs to use ITestOutputHelper instead of Console.WriteLine
- Update DotnetInternal.cs to pass ITestOutputHelper, add OutputBuildErrorsFromBinLog
- Update XHarness.cs to pass ITestOutputHelper to all methods
- Update Adb.cs and Emulator.cs (Android) to use ITestOutputHelper
- Update Simulator.cs (Apple) to store ITestOutputHelper as field
- Update BuildWarningsUtilities.cs with new OutputBuildErrorsFromBinLog method
- Update all test files to pass output: _output to DotnetInternal and XHarness calls
- Add ShowLiveOutput property to Microsoft.Maui.IntegrationTests.csproj

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>

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 ports logging improvements from PR #33624 to make Integration Test output visible in Azure DevOps CI. The changes replace Console.WriteLine with ITestOutputHelper for test output capture, as Azure DevOps does not capture console output but does capture xUnit test output.

Changes:

  • Added optional ITestOutputHelper? output parameter to all utility classes (ToolRunner, DotnetInternal, XHarness, Adb, Emulator, Simulator)
  • Replaced all Console.WriteLine calls with output?.WriteLine() for proper CI output capture
  • Added OutputBuildErrorsFromBinLog() method to extract and display build errors directly in test logs
  • Updated all test methods to pass output: _output to utility method calls
  • Added <ShowLiveOutput>true</ShowLiveOutput> to project file

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Microsoft.Maui.IntegrationTests.csproj Added ShowLiveOutput property to enable real-time test output
ToolRunner.cs Added optional output parameter, replaced Console.WriteLine with output?.WriteLine()
DotnetInternal.cs Added output parameter, changed ConstructBuildArgs to return tuple with binlogPath, added error extraction on build failure
BuildWarningsUtilities.cs Added OutputBuildErrorsFromBinLog() method to extract and display build errors from binlog files
XHarness.cs Added output parameter propagation throughout all methods
Adb.cs Added output parameter to all methods for Android emulator logging
Emulator.cs Added output parameter to all Android emulator management methods
Simulator.cs Added output parameter to constructor and all iOS simulator methods
WindowsTemplateTest.cs Updated all DotnetInternal calls to pass output: _output
SimpleTemplateTest.cs Updated all DotnetInternal calls to pass output: _output
SampleTests.cs Updated DotnetInternal.Build call to pass output: _output
ResizetizerTests.cs Updated DotnetInternal calls to pass output: _output
MultiProjectTemplateTest.cs Updated DotnetInternal and DotnetInternal.Run calls to pass output: _output
MacTemplateTest.cs Updated DotnetInternal calls to pass output: _output
BlazorTemplateTest.cs Updated DotnetInternal calls to pass output: _output
AppleTemplateTests.cs Updated DotnetInternal and XHarness calls to pass output: _output
AndroidTemplateTests.cs Updated DotnetInternal and XHarness calls to pass output: _output
AOTTemplateTest.cs Updated DotnetInternal.New and DotnetInternal.Build calls to pass output: _output

@rmarinho
rmarinho merged commit 0110fea into main Jan 21, 2026
33 of 34 checks passed
@rmarinho
rmarinho deleted the copilot/fix-logging-issues-except-common-targets branch January 21, 2026 17:54
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants