Delete obsolete NormalizePathBadGlobalroot test#12049
Merged
YuliiaKovalova merged 3 commits intomainfrom Jun 30, 2025
Merged
Conversation
Contributor
|
Hello @@copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo. |
Co-authored-by: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com>
Co-authored-by: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Reenable or permanently delete NormalizePathBadGlobalroot
Delete obsolete NormalizePathBadGlobalroot test
Jun 20, 2025
YuliiaKovalova
approved these changes
Jun 20, 2025
JanProvaznik
approved these changes
Jun 25, 2025
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.
The
NormalizePathBadGlobalroottest was skipped due to failing on newer .NET versions where path validation behavior has changed. This test was checking thatFileUtilities.NormalizePath(@"\\?\globalroot\XXX")would throw anArgumentException, but .NET Core 2.1+ no longer validates globalroot paths as a security concern.Problem
The test was expecting:
FileUtilities.NormalizePath(@"\\?\globalroot\XXX")to throwArgumentExceptionAssert.Null()to fail withNullExceptionRoot Cause
Similar to other path validation tests in the same file, .NET Core 2.1+ removed the security validation for globalroot paths that was present in .NET Framework. The underlying
Path.GetFullPath()method no longer throws exceptions for these paths.Solution
Permanently deleted the test since:
[WindowsFullFrameworkOnlyFact]to only run on older .NET Framework versionsChanges
NormalizePathBadGlobalroottest method (19 lines)#if FEATURE_LEGACY_GETFULLPATHconditional compilation blockFixes #4205.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
dnceng.pkgs.visualstudio.comdotnet test src/UnitTests.Shared/Microsoft.Build.UnitTests.Shared.csproj --filter NormalizePathBadGlobalroot --verbosity normal(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.