Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/xharness
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b0c8bf6dba
Choose a base ref
...
head repository: dotnet/xharness
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 866707736d
Choose a head ref
  • 9 commits
  • 121 files changed
  • 10 contributors

Commits on Mar 23, 2026

  1. Add 'session not created' to Chrome driver retry error snippets (#1575)

    The retry logic in GetChromiumDriver catches transient Chrome startup failures and retries up to 3 times. However, the error snippet list missed the broad 'session not created' pattern, which covers several Chrome crash variants including:
    
      session not created: Chrome instance exited.
      session not created: Chrome failed to start: crashed.
    
    The existing snippets ('exited abnormally', 'failed to start', etc.) have been added reactively over time as new error messages surfaced. Adding 'session not created' as a broader pattern covers current and future variants of this class of transient Chrome startup failure.
    
    Co-authored-by: Copilot <[email protected]>
    ilonatommy and Copilot authored Mar 23, 2026
    Configuration menu
    Copy the full SHA
    e5857fb View commit details
    Browse the repository at this point in the history

Commits on Mar 30, 2026

  1. Fix WASM EXIT message duplication causing GENERAL_FAILURE exit code (#…

    …1578)
    
    The JSON message processor concatenated payload and arguments fields
    (payload + " " + arguments), but for simple console.log() calls both
    contain the same text. This produced duplicated output like
    'WASM EXIT 0 WASM EXIT 0', and int.Parse on the substring threw
    FormatException, crashing the message processor with exit code 71.
    
    Use payload alone (fall back to arguments only when payload is null),
    and switch to int.TryParse for robustness.
    
    Fixes: dotnet/runtime#124544 (comment)
    
    Co-authored-by: Copilot <[email protected]>
    kotlarmilos and Copilot authored Mar 30, 2026
    Configuration menu
    Copy the full SHA
    28f5ed3 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2026

  1. [main] Update dependencies from dotnet/arcade (#1573)

    * Update dependencies from https://github.com/dotnet/arcade build 20260321.1
    On relative base path root
    Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk From Version 11.0.0-beta.26163.2 -> To Version 11.0.0-beta.26171.1
    
    * Update dependencies from https://github.com/dotnet/arcade build 20260327.6
    On relative base path root
    Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk From Version 11.0.0-beta.26163.2 -> To Version 11.0.0-beta.26177.6
    
    ---------
    
    Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
    dotnet-maestro[bot] and dotnet-maestro[bot] authored Mar 31, 2026
    Configuration menu
    Copy the full SHA
    3d43498 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2026

  1. Fix TaskCanceledException in TestReporter when ConnectedTask is cance…

    …led (#1544)
    
    * Fix TaskCanceledException in TestReporter when ConnectedTask is canceled
    
    When _listener.ConnectedTask is canceled (e.g. due to process timeout),
    Task.IsCompleted returns true but accessing .Result throws
    TaskCanceledException. This caused numerous test runs to report as
    HarnessException instead of reporting their actual result.
    
    Use IsCompletedSuccessfully instead of IsCompleted to guard .Result
    access - it only returns true for tasks that ran to completion (not
    canceled or faulted).
    
    Co-authored-by: Copilot <[email protected]>
    
    * Add regression test for canceled simulator launch
    
    Co-authored-by: Copilot <[email protected]>
    
    ---------
    
    Co-authored-by: Copilot <[email protected]>
    Co-authored-by: Vitek Karas <[email protected]>
    3 people authored Apr 2, 2026
    Configuration menu
    Copy the full SHA
    3fbd2c0 View commit details
    Browse the repository at this point in the history
  2. New structured log output for Apple and Android platforms (#1579)

    #### New: `RunSummaryEmitter` (shared by both platforms)
    Introduces a unified `RunSummaryEmitter` in `Microsoft.DotNet.XHarness.Common` that emits a structured JSON block delimited by `<<XHARNESS_RESULT_START>>` / `<<XHARNESS_RESULT_END>>` markers at the end of every run. The JSON contains:
    - Exit code and its name
    - Machine name and platform
    - Device info (name, OS version, architecture)
    - Manifest of produced files (test results, logs, etc.)
    - Helix job/work item URLs when running in Helix (for direct log access)
    
    Both Android and Apple platforms use this shared emitter, ensuring consistent output across all run types.
    
    #### Android improvements
    - **Logcat filtering**: Console output now shows only `DOTNET`-tagged logcat lines (the full unfiltered log is still written to the output file)
    - **File tracking**: `InstrumentationRunner` tracks all produced files (test results XMLs, logcat, bugreport) via `DiagnosticsFile` and includes them in the summary
    - **Device metadata**: Summary includes device serial, API version, and architecture (e.g., `arm64-v8a`, `x86`)
    
    #### Apple improvements
    - **`CopyLogsToMainLog` refactor**: Now runs for all targets including simulators (previously skipped). MacCatalyst correctly copies `SystemLog` instead of `ApplicationLog` since MacCatalyst apps run as native macOS processes
    - **Log collection**: `BaseOrchestrator` collects all file-backed logs into the diagnostics summary with their types (executionlog, testlog, systemlog, applicationlog, xmllog, etc.)
    - **MacCatalyst diagnostics**: Populates device info with local machine name and macOS version
    
    #### Common infrastructure
    - New `DiagnosticsFile` model in `CommandDiagnostics.cs` for tracking produced files
    - `IDiagnosticsData.Files` property added for file manifest support
    - `xharness-result.json` written to output directory for downstream tooling
    matouskozak authored Apr 2, 2026
    Configuration menu
    Copy the full SHA
    e396a85 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2026

  1. Add retry logic to Firefox driver startup (#1580)

    * Add retry logic to Firefox driver startup
    
    GetFirefoxDriver used CreateWebDriver which has no retry, while
    GetChromiumDriver has a 3-attempt retry loop for transient startup
    failures. This causes flaky CI failures when geckodriver takes time
    to bind to its port — xharness gets 'Connection refused' errors
    followed by 'Cannot start the driver service' and exits with code 71.
    
    Add the same retry pattern to GetFirefoxDriver: 3 attempts with
    retryable error snippets including 'Cannot start the driver service'
    and 'Connection refused'. Also enable verbose geckodriver logging
    to aid future diagnosis.
    
    Related: dotnet/runtime#104349, dotnet/runtime#126489
    
    Co-authored-by: Copilot <[email protected]>
    
    * Fix build: remove Chromium-specific logging properties from FirefoxDriverService
    
    FirefoxDriverService in Selenium 4.0.0-alpha05 does not have
    EnableAppendLog, EnableVerboseLogging, or LogPath properties.
    These are ChromiumDriverService-specific. Remove them from the
    Firefox retry loop.
    
    Co-authored-by: Copilot <[email protected]>
    
    ---------
    
    Co-authored-by: Copilot <[email protected]>
    lewing and Copilot authored Apr 4, 2026
    Configuration menu
    Copy the full SHA
    0668c80 View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2026

  1. [main] Update dependencies from dotnet/arcade (#1581)

    * Update dependencies from https://github.com/dotnet/arcade build 20260404.1
    On relative base path root
    Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk From Version 11.0.0-beta.26177.6 -> To Version 11.0.0-beta.26204.1
    
    * Update dependencies from https://github.com/dotnet/arcade build 20260411.1
    On relative base path root
    Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk From Version 11.0.0-beta.26177.6 -> To Version 11.0.0-beta.26211.1
    
    ---------
    
    Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
    dotnet-maestro[bot] and dotnet-maestro[bot] authored Apr 13, 2026
    Configuration menu
    Copy the full SHA
    791fb58 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2026

  1. Improve nullability. (#1586)

    * Improve nullability.
    
    Sprinkle nullability information in a number of places where it makes sense.
    
    * Fix nullability mismatches
    
    Co-authored-by: Copilot <[email protected]>
    
    * Handle nullable log writes
    
    Co-authored-by: Copilot <[email protected]>
    
    * Fix Windows null log test
    
    Co-authored-by: Copilot <[email protected]>
    
    * Handle null Apple env vars gracefully
    
    Skip null-valued env vars when building Apple mlaunch arguments so the new nullable contract doesn't fail at runtime. Add regression tests covering the run and test simulator paths.
    
    Co-authored-by: Copilot <[email protected]>
    
    ---------
    
    Co-authored-by: Copilot <[email protected]>
    Co-authored-by: vitek-karas <[email protected]>
    3 people authored Apr 14, 2026
    Configuration menu
    Copy the full SHA
    84f48de View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2026

  1. Add --enable-coverage flag for code coverage collection from device t…

    …ests (#1565)
    
    * Add --enable-coverage flag for collecting code coverage from device tests
    
    Adds optional `--enable-coverage` CLI flag across all platforms (Android,
    Apple/iOS/tvOS, WASM) that enables code coverage collection during test
    execution. When enabled, XHarness coordinates coverage output paths and
    transports the resulting Cobertura XML files from the device back to the
    host output directory alongside test results.
    
    Changes:
    - New `--enable-coverage` switch argument shared across all platforms
    - `NUNIT_ENABLE_COVERAGE` / `NUNIT_COVERAGE_OUTPUT_PATH` env var support
      in ApplicationOptions for test runner configuration
    - CoverageManager that generates method-level Cobertura XML via reflection
      when no external coverage tool (coverlet) produces a file
    - Android: coverage flag passed as instrumentation arg, InstrumentationRunner
      pulls coverage-results-path from device via adb
    - Apple: coverage env vars injected into app environment for simulator/device
    - WASM: coverage data decoded from STARTCOVERAGEXML stdout markers
    - ThreadlessXunitTestRunner made public (enables Android apps to use the
      runner that works with assembly store, required for device testing)
    - Unit tests for CoverageManager
    
    Closes #1135
    
    * Update CoverageManager docs: clarify coverlet is not needed
    
    CoverageManager generates coverage via reflection — no external tool
    required. Standard tools like coverlet.msbuild cannot instrument
    assemblies for device builds (APK/app bundles) since they only hook
    into the dotnet test pipeline.
    
    * Re-trigger CI (previous run hit Helix device lab infrastructure failure)
    
    * Remove reflection-based coverage generation and integrate with structured log
    
    - Strip CoverageManager down to only finding external coverage files
      (remove GenerateReflectionCoverage and assembly metadata scanning)
    - Android: add coverage file to DiagnosticsFile manifest after adb pull
    - Apple: add CopyCoverageResultsAsync to pull coverage from app container
      on iOS 18+, include coverage file in EmitAppleRunSummary manifest
    - Update tests for simplified CoverageManager API
    
    * Address review feedback from vitek-karas
    
    - Collect coverage results regardless of test outcome (remove FailedTests == 0 guard)
    - Only copy coverage file on Apple when --enable-coverage was passed
    - Derive coverage source path from NUNIT_COVERAGE_OUTPUT_PATH env var instead of hard-coding
    - Revert ThreadlessXunitTestRunner back to internal (unrelated to coverage)
    
    * Use copied Apple coverage file in diagnostics
    
    Co-authored-by: Copilot <[email protected]>
    
    * Fix Apple coverage env var nullability
    
    Co-authored-by: Copilot <[email protected]>
    
    * Fix Apple coverage file copying
    
    Ensure MacCatalyst collects the copied coverage report and deduplicate the Apple app-container file copy logic, including retry behavior for coverage files.
    
    Co-authored-by: Copilot <[email protected]>
    
    ---------
    
    Co-authored-by: vitek-karas <[email protected]>
    Co-authored-by: Copilot <[email protected]>
    3 people authored Apr 17, 2026
    Configuration menu
    Copy the full SHA
    8667077 View commit details
    Browse the repository at this point in the history
Loading