-
Notifications
You must be signed in to change notification settings - Fork 290
Fix MTP timeout parsing to use invariant culture instead of current culture #5705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Youssef1313 <[email protected]>
src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs
Outdated
Show resolved
Hide resolved
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
…Float parameter Co-authored-by: Youssef1313 <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…NumberStyles.Float parameter Co-authored-by: Youssef1313 <[email protected]>
Co-authored-by: Youssef1313 <[email protected]>
src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Youssef1313 <[email protected]>
…Builder.cs Co-authored-by: Youssef1313 <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
|
@Youssef1313 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
...itTests/Microsoft.Testing.Platform.UnitTests/CommandLine/PlatformCommandLineProviderTests.cs
Outdated
Show resolved
Hide resolved
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5705 +/- ##
==========================================
- Coverage 76.37% 73.90% -2.48%
==========================================
Files 602 602
Lines 36664 36664
==========================================
- Hits 28003 27095 -908
- Misses 8661 9569 +908
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
The
--timeoutoption parsing was using the current culture forfloat.TryParse(), which could cause parsing failures in locales that use different decimal separators (e.g., comma instead of period in German locale).Changes Made
Fixed two locations where timeout values are parsed:
PlatformCommandLineProvider.cs- Validation logic now usesCultureInfo.InvariantCultureTestHostBuilder.cs- Parsing logic now usesCultureInfo.InvariantCultureBefore
After
Tests Added
Added comprehensive unit tests to verify:
The fix ensures that timeout values like
--timeout 1.5swork consistently regardless of the user's system locale.Fixes #5451.
💡 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.