* Revert "[Wasm] Enable CopyWithData FileSystem test (#40663)"
This reverts commit 1821567ab6.
* Provide context for skipping Assert in Copy.cs
Co-authored-by: Mitchell Hwang <[email protected]>
* Revert " Use clonefile for CopyFile, if available (dotnet/corefx#37583)"
This reverts commit 02ba75ad0f.
* Add unit test
* Disable tests failing in browser-wasm
* Ensure FileStatus and FileSystemEntry IsHidden attribute is retrieved the same way
* Add missing check in public property FileSystemEntry.IsHidden. Address PR suggestions.
* Add tests for Hidden and ReadOnly attribute check for each platform. Split existing Skip attribute test into different platforms.
* Use _initialAttributes instead of Attributes for IsHidden. Add comment on top.
Co-authored-by: carlossanlop <[email protected]>
* Save last error info in SafeFileHandle.ReleaseHandle and read it in FileStream.Dispose
* Add manual test
* Remove Debug.Fail from SafeFileHandle, automate the drive filling step in the manual test, add suggested comments, make threadstatic field static.
* Address suggestions
* Update src/libraries/System.IO.FileSystem/tests/ManualTests/ManualTests.cs
Co-authored-by: Jan Kotas <[email protected]>
Co-authored-by: carlossanlop <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
* [browser][file system] Tests System.IO.FileSystem
* Remove FileSystem from test project exclusions.
* [browser][filesystem] Comment on skipped tests due to IO.Pipes not supported
* [browser][filesystem] Comment on skipped tests due to monitor not supported
* Address review comments
* Address review comments on how to handle monitor PNSE
* Update src/libraries/System.IO.FileSystem/tests/File/GetSetTimes.cs
Co-authored-by: Jan Kotas <[email protected]>
* Add ActiveIssue for browser platform
```
[ActiveIssue("https://github.com/dotnet/runtime/issues/39955", TestPlatforms.Browser)]
public void NotFoundErrorIsExpected()
```
* Simplify test case with `PlatformDetection.IsSuperUser` as per review comment
* Remove unused variable from tests
* Browser platform volume does not limit each component of the path to a total of 255 characters.
- Remove the test `DirectoryWithComponentLongerThanMaxComponentAsPath_ThrowsException` for Browser platform.
- Add new test `DirectoryWithComponentLongerThanMaxComponentAsPath_BrowserDoesNotThrowsException` for Browser platform in case this check is added in the future.
* Fix windows tests
* Add ActiveIssue to test System.IO.Tests.DirectoryInfo_Name.CurrentDirectory
- System.IO.Tests.DirectoryInfo_Name.CurrentDirectory does not pass because it is using Path.GetFileName on the current directory of "/".
- See issue https://github.com/dotnet/runtime/issues/39998 for more information
* Add active issue for tests that need to support file locking.
* Add active issue for tests that need to support file locking.
* Browser volume does not have a limit on segments
* Remove browser platform test
* Remove active issue for NotFoundErrorIsExpected
* Remove platform specific from SkippingHiddenFiles
* Fix enumeration test errors failing from `HiddenFilesAreReturned`.
- WebAssembly (BROWSER) has dirent d_type but is not identifying correctly but by returning UNKNOWN the managed code properly stats the file to detect if entry is directory or not.
* Fix enumeration test errors failing from `HiddenFilesAreReturned`.
- WebAssembly (BROWSER) has dirent d_type but is not identifying correctly but by returning UNKNOWN the managed code properly stats the file to detect if entry is directory or not.
* Fix build for TARGET_WASM not defined
* Address review comment by add check for IsWindows to IsSuperUser.
* Address review comment by add check for IsWindows to IsSuperUser.
* Platform Specific test for hidden files no longer needed.
* Platform Specific test fno longer needed.
* Use active issue for rename issue
* ActiveIssue no longer needed
- PR https://github.com/dotnet/runtime/pull/40310 works around the issue for now while waiting for fix https://github.com/emscripten-core/emscripten/issues/11804 / https://github.com/emscripten-core/emscripten/pull/11812
* Use ActiveIssue for SettingUpdatesProperties
* Use ActiveIssue for TimesIncludeMillisecondPart
* Use ActiveIssue for ErrorHandlingTests failures
* Use ActiveIssue for SetUptoNanoseconds
* Use ActiveIssue for GetSetTimes test failures
* Use ActiveIssue for tests failing with DirectoryNotFoundException
* Use ActiveIssue for tests failing with UnauthorizedAccessException
* Remove debugging statement from pal_io
* Address type in CreateDirectory method name
Co-authored-by: Jan Kotas <[email protected]>
Co-authored-by: Mitchell Hwang <[email protected]>
* Remove unused locals in System.IO.FileSystem.AccessControl
* Removed unused locals in System.IO.FileSystem.DriveInfo
* Remove unused locals and methods in System.IO.FileSystem
* [libraries] Replacee IsNotApple with IsApple
* [libraries] Extend PlatformDetection.IsOSX to include all Apple OS
* [libraries] Remove test case from DateTimeFormatInfoData
* [Libraries] Rename IsApple to IsOSXLike
* [libraries] Revert GdiplusTests condition from IsOSXLike to IsOSX
Co-authored-by: Mitchell Hwang <[email protected]>
* Invalidate upon delete and create for fileinfo and directoryinfo
* Add tests, remove directory info test that tested removed behavior
* Add delete test
* Fix typoe in directoryinfo
* Remove new line, and refactor away private method into delete method with paramter
* Change set time tests
* Code review linting as well as test change
* Modify other test that tested prior behavior
* Rework Reset test
* Edits for comments in tests
* Slight method refactor
* Minor test cleanup
Changes:
- enabled `runtime (Libraries Test Run release mono Windows_NT x64 Debug)` CI lane (Windows Nano Server CI leg is disabled);
- enabled the tests that pass;
- marked failing test assemblies/classes/methods with `ActiveIssue` attribute using respective GH issues;
- removed CoreFX.issues_windows.rsp file and related mono rsp arguments.
Fixes#1980
* Enable analyzer rule xUnit1024
* Remove redundant test in System.Text.Json
The very next method is a Theory with inline data that tests this
exact scenario.
* Rename test methods in System.Text.Json
* Rename test methods in System.ComponentModel.Annotations
* Private methods -> local functions in System.Text.Json
* Rename test methods in System.Collections.Immutable
For RemoveNonExistingTest, just moved the logic from the single-use
helper into the method with the Fact attribute.
* Rename test methods in System.Globalization
* Rename test methods in System.Runtime.Extensions
In Math.cs, removed Round_Decimal_Digits Fact which manually tested
cases included in the MemberData of a Theory with the same name.
* Rename test methods in System.Private.Uri
* Rename test methods in System.Runtime.WindowsRuntime.UI.Xaml
* Rename test methods in System.Security.Cryptography.X509Certificates
* Rename test methods in System.Reflection
* Remove redundant test in System.IO.FileSystem.Watcher
Theory EndInit_ResumesPausedEnableRaisingEvents alredy tests
the same scenario as the removed Fact of the same name.
* Rename test methods in System.IO.FileSystem.Watcher
* Rename test methods in System.Composition.Runtime
* Rename test methods in System.Drawing.Primitives
* Rename test methods in System.Reflection.Emit
* Rename test methods in System.Text.RegularExpressions
* Private methods -> local functions in System.Threading.Tasks.Parallel
* Rename test methods in System.Threading.Tasks.Parallel
* Rename test methods in System.Threading.Tasks
* Simplify tests in System.Threading
* Rename test methods in System.Threading
* Rename test methods in Microsoft.VisualBasic.Core
* Rename test methods in System.DirectoryServices.AccountManagement
* Private methods -> local functions in System.Text.Encoding
* Rename test methods in System.Text.Encoding
* Rename test methods in System.Security.Cryptography.Primitives
* Rename test methods in System.Runtime.Numeric
* Rename test methods in System.CodeDom.Tests
* Rename test methods in System.Reflection.Emit.ILGeneration
* Rename test methods in System.Composition.AttributedModel
* Rename test methods in System.Data.DataSetExtensions
* Rename test methods in System.Runtime
* Rename test methods in System.Runtime.InteropServices
* Remove redundant test in System.ServiceModel.Syndication
* Rename test methods in System.ServiceModel.Syndication
* Rename test methods in System.Data.Common
* Rename test methods in System.Security.Cryptography.Xml
* Private methods -> local functions in System.Security.Cryptography.Xml
* Simplify tests in System.Security.Cryptography.ProtectedData
* Replace private methods with local functions...
In System.Security.Cryptography.Algorithms
* Rename test methods in System.Security.Cryptography.Algorithms
* Simplify tests code in System.Collections.Concurrent
* Rename test methods in System.Drawing.Common
* Rename test methods in System.Data.OleDb
* Rename test methods in System.ComponentModel.TypeConverter
* Rename test methods in System.Web.HttpUtility
* Rename test methods in System.Linq
* Private method -> local function in System.Linq
* Rename test methods in System.Memory
* Rename test methods in System.IO.IsolatedStorage
* Rename test methods in System.DirectoryServices.Protocols
* Rename test methods in System.Globalization.Extensions
* Private methods -> local functions in System.Globalization.Extensions
* Rename test methods in System.IO.Compression
* Rename test methods in System.Security.Cryptography.Encoding
* Rename test methods in Microsoft.Win32.Registry
* Rename test methods in System.IO.UnmanagedMemoryStream
* Rename test methods in System.Collections
* Rename test methods in System.Collections.Specialized
* Rename test methods in System.Private.Xml
* Rename test methods in System.IO.FileSystem
* Rename test methods in System.Diagnostics.StackTrace
* Rename test methods in System.Diagnostics
* Improve some test method renames
* Minor nit fixing
* More improvements to test method names
* libraries -restore for vertical build without test restore
* Automatic test change and regex to remove the addition of an extra line at eof
* manual test restore fixed (restore completely done for vertical build)
* build native done
* Automatic ref change and regex to remove the last line
* manual reference assebly change and generated shims build
* automatic src change and regex
* native bin place and src build manual change
* apicompat and pretest.csproj done
* fixing the package build
* fixing all config
* packaging and feedback
* adding back placeholder configuration
* fixing the shims
* delete configuration.props
* making the build work in master
* Test Change
* fixing the packageing, test restore replacing TargetFramework -> OriginalTargetFramework
* delete test configuraiton.props, trailing semicolon and use targetFramework
* reverting the package change
* enable apicompat and fixing configurationGroup for individual projects
* fixing the api compat
* making ilproj work
* adding the outerBuildTest
* adding the arcade package version
* fixing the merge conflicts
* minor changes
* adding additional configs and setting the runtimeOS
* making the vs stuff work
* removing the target Group to fix the apicompat
* fixing the linux build and some minor changes
* making additionalBuildTargetFramework LOcalProperty
* fixing the allConfigurations build
* fixing the netfx build
* fixing package Testing and restore
* Missing TargetFrameworks tag
* making the VSdesgin stuff work
* Remove OriginalFramework Entirely
* some minor pr feedback
* RemoveExtraSemicolon
* use boolean exclude flag
* fixing yml scripts to pass tests
* adding comments and some minor feedback
* moving packaging property to correct plave
* fixing the build for web assembly
* Fixing the live ci build
* Fixing the live build for shims
* fixing the tests
* fixing the packaging and enterprise linux
* fixing package sizes
* Fix the targetFramework
* updating the targetFramework sdl
* removing the buildOS and be able to use OSGroup as done in the old system
* Fixing the osgroup stuff for send to helix task
* Fix OSX failures
* Fixing the osx build
* uploading tmp folder to artifacts
* running restore for runtime.deproj correctly
- In some cases, I deleted ActiveIssues associated with issues where the problem was supposedly fixed. We'll see.
- In some cases, I deleted test cases entirely, e.g. where the corresponding issue said effectively "we'll live with the behavior" or "another repo is responsible for this now" (paraphrasing), or where the tests were initially added to the repo years ago already disabled and against bug numbers from some old bug database.
- In some cases, I replaced the link with the correct one.
- In some cases, I re-opened closed issues.
* FinalCoreFXRenames
The last of the CoreFX renames.
* Update DirectorySearcher.cs
Fixed typo in DirectorySearcher.cs
* Update TestClasses.SimpleTestClassWithObjectArrays.cs
This fixes the expected value of the tests to runtime, instead of corefx.
* Update PersistedFiles.Names.Unix.cs
Adds a note to not update the corefx reference.
* Address more issue numbers in the code
Replaced a bunch of unadorned issue numbers with links, so we know which repo the issue is for. In some cases the repo was named, but for consistency I still replaced it with a link.
In some cases, in particular where the issue had been closed saying effectively "we're not going to do anything here", I removed TODOs and the associated issue numbers.
In a few cases, the TODO and issue number was to say "we should do X when Y is fixed", so I did X since Y was fixed.
* Apply suggestions from code review
Co-Authored-By: Jan Kotas <[email protected]>
* Address PR feedback
* Fix OrderedEnumerable by using MemoryExtensions.Sort
Co-authored-by: Jan Kotas <[email protected]>
* netcoreapp -> netcoreapp5.0 in .sln files
* netcoreapp; -> netcoreapp5.0; , netcoreapp- to netcoreapp5.0-
* netcoreapp- -> netcoreapp5.0 in .csproj
* 'netcoreapp -> 'netcoreapp5.0 in .csproj
* done with libraries sub folder
* missed semicolon
* minor changes
* netcoreapp -> netcoreapp5.0 in some extra files
* vNext target variable in configurations.props
* netcoreapp => netcoreapp5/0 in some other .props file
* netcoreapp -> vnext in .csproj
* making the netcorepap framework switch work
* fixing sendToHelix and linux build
* TargetFrameworkVNext -> netcoreappCurrent
* case correct netcoreappcurrent
* fixing send to helix zip path
* netfx -> net472 in .sln
* netfx; -> net472; in .props
* netfx- -> net472- in .props
* netfx - -> net472- in .csproj
* 'netfx-> 'net472 in .csproj
* netfx -> net472 manual change
* fixing ci build for netfx
* Not trying to change the global property
* Fixing build failure due to master changes in net https tests
* adding documentaiton and fixing filtering
* netcoreapp -> netcore5.0 in py file
* changing the path to use netcoreapp5.0 version
* feedback and override corefx path corrected in installers
* remaing netcoreapp5.0 changes done
* netcoreapp-> netcoreapp5.0 after live builds
* net472 -> netframeworkcurrent
* Fix test build break and update common path usages to use property
* Use normalize directory for CommonPath and CommonTestPath
* Update instances of CommonPath and CommonTestPath to not use trailing \
* Fix to support case-insensitive directory moving/renaming
* More tests for other directories
* Include throwing win32 exp upon directory already existing
* Added ) that I dropped in previous rebase
* Directory get with pattern to check for case sensitivity
* Error message fix
* Rework to support multiple edge cases
* Rework to only support moving to the same directory case insentivity
* Handle situations for case-sensitive file systems
* Test changes
* Stopped modifying environment's current directory
* Cleanup, and tests for drive differences
* Only set route to lower, but only only compare roots ordinally
* Add additional if to check if any directory with that name exists
* Edit to what path to use
* Use destination path.
* Rework file directory scan
* Make utility function due to Any() with empty returning true
* Get the full path before getting the filename
* Check if the directory name is null or empty
* Removed extra line
* Now Defering to the OS for if the directory already exists
* Remove extra semi-colon
* Test Edit
* Comment edit
* Actually test the functionality the test is built for
* Remove platform specific tests and make them platform agnostic
* Target only OSX
* Target all platforms other than linux itself
* Changed how we detect case variants
* Remove unix specific test
* Convert OSX test into no-op test
* Code review feedback and additional tests
* Case-Sensitive file systems specific tests
* Fix to not include osx with other unixes
* Removed a ,
Commit migrated from https://github.com/dotnet/corefx/commit/e9ce2f734698ab5bf13f947c281fa4bec67b0216
Approved API Proposal: dotnet/corefx#41614
Related change for directory creation method that takes an ACL: dotnet/corefx#41834 -merged and ported to 3.1 Prev2
Description
We have extension methods in System.IO.FileSystem.AclExtensions that let the user get and set ACLs for existing files, but we do not have methods that create files with predefined ACLs.
.NET ACL (Access Control List) support is Windows specific. This change will reside inside the System.IO.FileSystem.AccessControl assembly.
Customer impact
Before this change, customers had to create a file or filestream, then set its ACLs. This presents a few problems:
Potential security hole as files can be accessed between creation and modification.
Porting difficulties as there isn't a 1-1 API replacement
Stability issues with background processes (file filters) can prevent modifying ACLs right after creation (typically surfaces as a security exception).
This change addresses those problems by adding a new extension method that allows creating a file and ensuring the provided ACLs are set during creation.
This change is expected to be backported to 3.1.
Commit migrated from https://github.com/dotnet/corefx/commit/508cbc4f1021e260b52981b8510cc5a5881441d3
Many of our RemoteInvokes are there purely because of needing to change the current thread culture but on UAP that actually impacting the whole process. Until that's addressed, we can at least avoid the RemoteInvoke on all platforms other than UAP. There are also some RemoteInvokes that can be avoided by just serializing all of the (small number of) tests in a test assembly. And there's some additional cleanup to be done as well around not explicitly returning an exit code unless required.
This helps measurably with test performance. Consider the System.ComponentModel.Annotations test suite. On my machine, prior to these changes, it took ~25 seconds; after these changes, it takes ~0.3. It helps even more when running against a checked runtime, where all of our test costs are magnified. With a checked runtime, prior to these changes, it takes ~196 seconds; after these changes, it takes ~2.5 seconds. This should help measurably with CI time in coreclr.
Commit migrated from https://github.com/dotnet/corefx/commit/cd18bafbabf7fe47601f6f790d157409034a2477
Mechanical/automated change. The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.
Commit migrated from https://github.com/dotnet/corefx/commit/09a6e66b0c2b31bd0f6e7e3170537d14027aeed0
* Re-enable xunit warning 1026 (unused theory arguments)
Some of these were addressed by explicitly discarding theory arguments, generally in cases where either a) the argument was being used as a description to aid in debugging failures, or b) the argument was part of a member data that was used by some theories and not by others all sharing the same member data.
However, there are quite a few legitimate bugs being fixed here, enough that highlights it's worthwhile to have the rule enabled. Some are cases where the argument was supposed to be used but wasn't. Some are cases where the argument isn't used at all, and in many cases where we end up running the same test over and over and wasting cycles. Some are cases where we're unnecessarily including irrelevant inputs to the tests and making the input data more complicated than it needs to be. Etc.
(Along the way, I also fixed some cases where VS was warning about lambdas being used instead of local functions, and in cases where I agreed I fixed them, via auto-fixers.)
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/daf93ee0e5e5233141eb762c64b6049cfd7d123e
* Fix ordering of keywords in member signatures
* Add StyeCop.Analyzers
Most rules are disabled. Many of them we'll want to leave disabled, however there are a handful it'll be good to enable over time.
* Use built-in type alias
* Fix straggling stylecop warnings in all configurations
* Replace tabs with spaces
Commit migrated from https://github.com/dotnet/corefx/commit/a12c557a72988070b8624cc7ecc46899629895c4