Skip to content

[xharness] Enable nullability, and fix any errors.#25160

Merged
rolfbjarne merged 3 commits intomainfrom
dev/rolf/xharness-nullability
Apr 17, 2026
Merged

[xharness] Enable nullability, and fix any errors.#25160
rolfbjarne merged 3 commits intomainfrom
dev/rolf/xharness-nullability

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

Also remove the tests, they're not running and have bitrotted.

@rolfbjarne rolfbjarne requested a review from Copilot April 15, 2026 22:32
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

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

Updates the tests/xharness harness to compile with nullable reference types enabled, while also removing the xharness unit test project and its sample assets (per the PR description) to reduce maintenance burden.

Changes:

  • Enable <Nullable>enable</Nullable> for xharness and update code to satisfy nullable warnings.
  • Refactor xharness Jenkins/task plumbing away from several I* interfaces toward concrete types and nullable-aware APIs.
  • Remove Xharness.Tests project (tests + samples) and editor launch/task configs.

Reviewed changes

Copilot reviewed 83 out of 84 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/xharness/xharness.slnx Removes the Xharness.Tests project from the solution.
tests/xharness/xharness.csproj Enables nullable, switches back to default compile items, and removes test/importer compile exclusions.
tests/xharness/XmlDocumentExtensions.cs Nullable-related signature changes and null-suppression updates in save helper.
tests/xharness/Xharness.Tests/app.config Removed (tests project deleted).
tests/xharness/Xharness.Tests/Xharness.Tests.csproj Removed (tests project deleted).
tests/xharness/Xharness.Tests/Tests/TestTargetExtensionsTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/Tests/TestPlatformExtensionsTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/Tests/AppRunnerTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/XamariniOSTemplateTest.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/TestAssemblyDefinitionTest.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/AssemblyLocatorTest.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/TestImporter/Tests/ProjectDefinitionTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/TestImporter/Templates/Tests/PListExtensionsTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/Samples/xUnitSample.xml Removed (tests project deleted).
tests/xharness/Xharness.Tests/Samples/run-log.txt Removed (tests project deleted).
tests/xharness/Xharness.Tests/Samples/devices.xml Removed (tests project deleted).
tests/xharness/Xharness.Tests/Samples/TestProject/SystemXunit.csproj Removed (tests project deleted).
tests/xharness/Xharness.Tests/Samples/TestProject/Info.plist Removed (tests project deleted).
tests/xharness/Xharness.Tests/Samples/NUnitV3SampleSuccess.xml Removed (tests project deleted).
tests/xharness/Xharness.Tests/Samples/NUnitV3SampleFailure.xml Removed (tests project deleted).
tests/xharness/Xharness.Tests/Samples/NUnitV3Sample.xml Removed (tests project deleted).
tests/xharness/Xharness.Tests/Samples/NUnitV2Sample.xml Removed (tests project deleted).
tests/xharness/Xharness.Tests/Jenkins/TestSelectorTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/Jenkins/TestSelectionTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/Jenkins/ResourceManagerTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/Jenkins/PeriodicCommandTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/Jenkins/MarkdownReportWriterTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/Jenkins/JenkinsDeviceLoadterTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/Jenkins/ITestTaskExtensionsTests.cs Removed (tests project deleted).
tests/xharness/Xharness.Tests/Jenkins/ErrorKnowledgeBaseTests.cs Removed (tests project deleted).
tests/xharness/TestReporterFactory.cs Nullable annotations added for optional parameters.
tests/xharness/TestReporter.cs Nullable annotations + null-suppression adjustments in parsing/reporting paths.
tests/xharness/TestProject.cs Makes Name non-null, refactors to use TestTask, and adjusts platform-name substitution.
tests/xharness/TestPlatformExtensions.cs Makes ToPlatformName nullable and returns null for unknown/flag combinations.
tests/xharness/Program.cs Enables nullable and updates CLI help callback to be nullable-aware.
tests/xharness/Jenkins/TestVariationsFactory.cs Removes interface, adds nullability to configuration/variation logic, and updates cloning/build task types.
tests/xharness/Jenkins/TestTasks/TestTask.cs Renames base task type and updates many members to nullable-aware forms; removes ITestTask implementation.
tests/xharness/Jenkins/TestTasks/RunXITask.cs Publicizes type and updates runner/device fields to be nullable-aware.
tests/xharness/Jenkins/TestTasks/RunTestTask.cs Removes IRunTestTask interface usage and shifts to concrete task/build types with nullable updates.
tests/xharness/Jenkins/TestTasks/RunTest.cs Switches to concrete RunTestTask/BuildToolTask and nullable working directory.
tests/xharness/Jenkins/TestTasks/RunSimulatorTask.cs Switches to concrete simulator loader type and nullable acquired resource handling.
tests/xharness/Jenkins/TestTasks/RunSimulator.cs Switches to concrete RunSimulatorTask/SimulatorLoader and adds null-suppression where required.
tests/xharness/Jenkins/TestTasks/RunDeviceTask.cs Removes IRunDeviceTask interface usage and updates nullable progress message.
tests/xharness/Jenkins/TestTasks/RunDevice.cs Switches to concrete RunDeviceTask and adds nullable tunnel handling / runner null-suppression.
tests/xharness/Jenkins/TestTasks/Resource.cs Nullable description + safe dequeue typing updates.
tests/xharness/Jenkins/TestTasks/MacTask.cs Nullable Mode override.
tests/xharness/Jenkins/TestTasks/MacExecuteTask.cs Switches to concrete crash reporter factory type and adds nullability annotations/suppressions.
tests/xharness/Jenkins/TestTasks/MSBuildTask.cs Publicizes type, adds nullability checks/suppressions, and aligns env var dictionary value type.
tests/xharness/Jenkins/TestTasks/MSBuild.cs Makes tool arg inputs nullable and returns nullable known-failure result.
tests/xharness/Jenkins/TestTasks/ITestTaskExtensions.cs Updates extensions to work with concrete TestTask instead of removed interface.
tests/xharness/Jenkins/TestTasks/ITestTask.cs Removed (interface eliminated).
tests/xharness/Jenkins/TestTasks/IRunXITask.cs Removed (interface eliminated).
tests/xharness/Jenkins/TestTasks/IRunTestTask.cs Removed (interface eliminated).
tests/xharness/Jenkins/TestTasks/IRunSimulatorTask.cs Removed (interface eliminated).
tests/xharness/Jenkins/TestTasks/IRunDeviceTask.cs Removed (interface eliminated).
tests/xharness/Jenkins/TestTasks/IBuildToolTask.cs Removed (interface eliminated).
tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs Null-suppression for working directory/dotnet path usage.
tests/xharness/Jenkins/TestTasks/DotNetBuild.cs Aligns override signature with nullable tool-arg parameters.
tests/xharness/Jenkins/TestTasks/BuildToolTask.cs Removes IBuildToolTask and makes build log nullable.
tests/xharness/Jenkins/TestTasks/BuildTool.cs Makes key properties non-null default/nullable where appropriate.
tests/xharness/Jenkins/TestTasks/BuildProjectTask.cs Cast-based access and nullable solution path.
tests/xharness/Jenkins/TestTasks/AppleTestTask.cs Switches base class and replaces IHarness with concrete Harness.
tests/xharness/Jenkins/TestServer.cs Improves null-safety around request URL parsing and task list typing.
tests/xharness/Jenkins/TestSelector.cs Publicizes TestSelection and shifts to concrete Harness usage.
tests/xharness/Jenkins/TestData.cs Nullable fields for optional variation metadata.
tests/xharness/Jenkins/RunSimulatorTasksFactory.cs Candidate typing fix for simulator devices.
tests/xharness/Jenkins/Reports/MarkdownReportWriter.cs Updates report writer inputs to TestTask concrete type.
tests/xharness/Jenkins/Reports/IReportWriter.cs Updates interface to accept IList<TestTask>.
tests/xharness/Jenkins/Reports/HtmlReportWriter.cs Updates report writer inputs to TestTask concrete type and nullable locals.
tests/xharness/Jenkins/MacTaskTestsFactory.cs Switches to concrete crash reporter factory type.
tests/xharness/Jenkins/JenkinsDeviceLoader.cs Publicizes device loader type.
tests/xharness/Jenkins/Jenkins.cs Publicizes Jenkins class, switches to concrete harness/simulator loader types, and updates task list typing.
tests/xharness/IHarness.cs Removed (interface eliminated).
tests/xharness/IAppBundleInformationParserExtensions.cs Narrows _appBundleLocator parameter type and updates nullability.
tests/xharness/Harness.cs Enables nullable, removes IHarness interface, and updates env var/path handling + null-suppression.
tests/xharness/GitHub.cs Switches from IHarness to concrete Harness and updates null-suppression.
tests/xharness/DeviceLogCapturerFactory.cs Removes factory interface and makes device name nullable.
tests/xharness/CrashSnapshotReporterFactory.cs Removes factory interface and makes device name nullable.
tests/xharness/AppRunner.cs Updates dependencies to concrete factory types and adds many nullability changes.
tests/xharness/AppBundleLocator.cs Makes LocateAppBundle nullable and updates property-inspection helper signatures.
tests/xharness/.vscode/tasks.json Removed (editor config cleanup).
tests/xharness/.vscode/launch.json Removed (editor config cleanup).
Comments suppressed due to low confidence (1)

tests/xharness/TestPlatformExtensions.cs:44

  • ToPlatformName returns null for None, All, and any future/unknown values. Downstream code uses this value for MSBuild property substitution; returning null here can lead to silent misconfiguration. Prefer returning a non-null string for all supported values and throwing for invalid flag combinations (like All) so errors are caught early.

Comment thread tests/xharness/AppRunner.cs
Comment thread tests/xharness/TestProject.cs
Comment thread tests/xharness/XmlDocumentExtensions.cs
Comment thread tests/xharness/Harness.cs
Comment thread tests/xharness/IAppBundleInformationParserExtensions.cs
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #a0f5bb6] Build passed (Build packages) ✅

Pipeline on Agent
Hash: a0f5bb6eaf2d9b9dc40ad03853c49931eca987d9 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #a0f5bb6] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: a0f5bb6eaf2d9b9dc40ad03853c49931eca987d9 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: a0f5bb6eaf2d9b9dc40ad03853c49931eca987d9 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #a0f5bb6] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: a0f5bb6eaf2d9b9dc40ad03853c49931eca987d9 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne marked this pull request as ready for review April 16, 2026 21:34
@rolfbjarne rolfbjarne enabled auto-merge (squash) April 16, 2026 21:34
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🚀 [CI Build #a0f5bb6] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 156 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: a0f5bb6eaf2d9b9dc40ad03853c49931eca987d9 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne merged commit 9d6da66 into main Apr 17, 2026
44 checks passed
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.

4 participants