Report raw invalid IsTargetPlatformInferred value, cover host x64 forcing - #16295
Merged
Jakub Jareš (nohwnd) merged 2 commits intoJul 21, 2026
Merged
Conversation
Follow-up to the review on microsoft#16271. The SettingsException for an invalid <IsTargetPlatformInferred> reported the parsed bool (always False) instead of the value the user wrote. Report the raw text, like the other RunConfiguration bool elements do. Add DotnetTestHostManager coverage that pins the target platform (IsTargetPlatformInferred=false) and proves the host is not silently forced to x64, while an inferred platform still is. 🤖
Contributor
There was a problem hiding this comment.
Pull request overview
This PR is a follow-up to #16271 that improves RunSettings validation diagnostics and adds targeted regression coverage around DotnetTestHostManager host/muxer architecture selection when <IsTargetPlatformInferred> is present/absent.
Changes:
- Fix
RunConfiguration.FromXmlto report the raw invalid<IsTargetPlatformInferred>value in the thrownSettingsException(instead of the default parsedboolvalue). - Extend
RunConfigurationTeststo assert the exception message includes the user-provided invalid text. - Add a
DotnetTestHostManagerunit test that verifies x64 muxer forcing happens only when the target platform was inferred, and not when explicitly pinned.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DotnetTestHostManagerTests.cs | Adds regression coverage ensuring x64 muxer forcing depends on <IsTargetPlatformInferred> when simulating OSX ARM64 + pre-net6 target. |
| test/Microsoft.TestPlatform.ObjectModel.UnitTests/RunSettings/RunConfigurationTests.cs | Updates the invalid-value test to assert the exception reports the raw text the user provided. |
| src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs | Changes the exception formatting to use the raw element content for invalid <IsTargetPlatformInferred> values. |
Tighten the invalid-value test to check the complete SettingsException message instead of a substring, matching the invalid-value tests for the other RunConfiguration bool settings. This also keeps the test identical to the one in the sibling follow-up PR so the two branches merge without a conflict. 🤖
github-actions Bot
added a commit
that referenced
this pull request
Jul 22, 2026
…ters settings exceptions Follow-up to #16295 which fixed the same issue for IsTargetPlatformInferred. When bool.TryParse fails, boolValue is always False regardless of what the user wrote. The error message should report element (the raw user input) so the diagnostic is actionable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Sep 9, 2026
This was referenced Sep 10, 2026
github-actions Bot
added a commit
to secana/PeNet
that referenced
this pull request
Sep 10, 2026
Updated [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 18.9.0 to 18.10.0. <details> <summary>Release notes</summary> _Sourced from [Microsoft.NET.Test.Sdk's releases](https://github.com/microsoft/vstest/releases)._ ## 18.10.0 ## What's Changed * Drop Mono fallback, run .NET Framework tests on Windows only by @nohwnd in microsoft/vstest#16158 * Run Microsoft.Testing.Platform test apps under `vstest.console` and datacollector by @nohwnd in microsoft/vstest#16201 * Fix test output eaten by MSBuild terminal logger by @nohwnd in microsoft/vstest#16223 * Remove the experimental test session feature by @nohwnd in microsoft/vstest#16231 * Skip a single bad executor instead of failing all executor loading by @nohwnd in microsoft/vstest#16239 * Assert apartment state instead of using Clipboard in UI tests by @nohwnd in microsoft/vstest#16270 * Surface test host crashes during protocol negotiation by @nohwnd in microsoft/vstest#16285 * Pass the inferred target platform to the host in run settings by @nohwnd in microsoft/vstest#16271 * Report raw invalid IsTargetPlatformInferred value, cover host x64 forcing by @nohwnd in microsoft/vstest#16295 * Disable the MTP testhost by default (#16337) by @nohwnd in microsoft/vstest#16341 **Full Changelog**: microsoft/vstest@v18.9.0...v18.10.0 Commits viewable in [compare view](microsoft/vstest@v18.9.0...v18.10.0). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
This was referenced Sep 10, 2026
Bump Microsoft.NET.Test.Sdk from 18.9.0 to 18.10.0
kudima03/Pure.Chart.RichRelationalModel.EFCore#78
Open
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.
Follow-up to the review on #16271.
Two things from Amaury's review:
The
SettingsExceptionfor an invalid<IsTargetPlatformInferred>reported the parsed bool (alwaysFalse) instead of the value the user actually wrote. It now reports the raw text, the same way the other RunConfiguration bool elements do.Added
DotnetTestHostManagercoverage that pins the target platform (<IsTargetPlatformInferred>false</IsTargetPlatformInferred>) and proves the host is not silently forced to x64, while an inferred platform still is. The test simulates osx-arm64 on a pre-net6.0 target so it stays off the Windows testhost.exe path and is deterministic on every CI OS.Verified locally in Release: RunConfiguration tests (29), TestHostProvider.UnitTests (117), ObjectModel.UnitTests (208) all pass.
🤖