Skip to content

Fix CommandLineOptionIsReserved provider placeholder and align validator message assertions#7771

Merged
Evangelink merged 3 commits into
mainfrom
copilot/fix-command-line-option-bug
Apr 23, 2026
Merged

Fix CommandLineOptionIsReserved provider placeholder and align validator message assertions#7771
Evangelink merged 3 commits into
mainfrom
copilot/fix-command-line-option-bug

Conversation

Copilot AI commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

CommandLineOptionIsReserved in PlatformResources.resx used {0} for both placeholders, so reserved-option errors repeated the option name instead of showing offending provider names. This change wires the second placeholder correctly and aligns tests with the intended behavior.

  • Resource string correction

    • Updated CommandLineOptionIsReserved from:
      • Option '--{0}' is reserved and cannot be used by providers: '{0}'
    • To:
      • Option '--{0}' is reserved and cannot be used by providers: '{1}'
  • Localization artifact update

    • Regenerated affected PlatformResources.*.xlf files to keep localized resources in sync with the .resx source change.
  • Command-line validator test updates

    • Updated CommandLineHandlerTests assertions to validate provider names in reserved-option failures.
    • For multi-provider cases, assertions now verify message content without assuming provider ordering.
stringBuilder.AppendLine(
    string.Format(
        CultureInfo.InvariantCulture,
        PlatformResources.CommandLineOptionIsReserved,
        kvp.Key,
        string.Join("', '", kvp.Value)));

Copilot AI self-assigned this Apr 22, 2026
Copilot AI review requested due to automatic review settings April 22, 2026 08:47
Copilot AI removed the request for review from Copilot April 22, 2026 08:47
Agent-Logs-Url: https://github.com/microsoft/testfx/sessions/8614ece4-f80d-4fb5-b412-b5f4974c66ea

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 22, 2026 08:57
Copilot AI changed the title [WIP] Fix pre-existing bug in CommandLineOptionIsReserved resource string Fix CommandLineOptionIsReserved provider placeholder and align validator message assertions Apr 22, 2026
Copilot AI requested a review from Evangelink April 22, 2026 09:00
@Evangelink Evangelink marked this pull request as ready for review April 22, 2026 11:06
Copilot AI review requested due to automatic review settings April 22, 2026 11:06

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

Fixes a formatting issue in the CommandLineOptionIsReserved localized resource so reserved-option validation errors can display the offending provider name(s) (instead of repeating the option name), and updates unit tests accordingly.

Changes:

  • Corrected CommandLineOptionIsReserved placeholder usage from {0}/{0} to {0}/{1}.
  • Updated CommandLineHandlerTests assertions to validate provider names and avoid provider-order assumptions.
  • Regenerated affected .xlf localization artifacts to reflect the updated source string.
Show a summary per file
File Description
test/UnitTests/Microsoft.Testing.Platform.UnitTests/CommandLine/CommandLineHandlerTests.cs Updates assertions to match the corrected reserved-option error message behavior.
src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx Fixes the resource string placeholder so provider names are displayed correctly.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.
src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf Syncs XLF CommandLineOptionIsReserved source/target with updated placeholder.

Copilot's findings

  • Files reviewed: 15/15 changed files
  • Comments generated: 13

Copilot AI requested a review from Evangelink April 22, 2026 11:13
@Evangelink Evangelink enabled auto-merge April 22, 2026 15:19
@Evangelink Evangelink merged commit 204d6c3 into main Apr 23, 2026
10 checks passed
@Evangelink Evangelink deleted the copilot/fix-command-line-option-bug branch April 23, 2026 14:28
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.

this is a pre-existing bug in the resource string CommandLineOptionIsReserved which uses {0} for both placeholders

5 participants