Repository navigation
feat: add support for .NET 11 - #1176
Merged
Merged
Conversation
This PR adds `net11.0` as a target framework and mirrors the new .NET 11 APIs in the core abstractions. It is the first of two steps: the core packages need to be released as a pre-release (`11.0.0-pre.1`) before the main packages can implement the new members, because they consume `Testably.Abstractions.Interface` as a NuGet package. ### Key changes - Added the `net11.0` target framework to the source and test projects and pinned the .NET 11 SDK (`11.0.100-rc.3.26522.148`) in `global.json`. The workflows install it via `global-json-file`, so moving to the final release only needs a change in `global.json`. - Added the feature flags `FEATURE_FILESYSTEM_HARDLINK`, `FEATURE_FILE_OPENNULLHANDLE` and `FEATURE_RANDOM_GENERIC` - Added the new .NET 11 APIs to the abstractions and their real implementations: - `IFile.CreateHardLink(string, string)` - `IFile.OpenNullHandle()` - `IFileInfo.CreateAsHardLink(string)` - `IRandom.NextInteger<T>()` - `IRandom.NextInteger<T>(T)` - `IRandom.NextInteger<T>(T, T)` - `IRandom.NextBinaryFloat<T>()` - Added `Net11ParityTests` and the `net11.0` API snapshots - Set the `BuildScope` to `CoreOnly`, so that only the core packages are built and published ### Follow-up After the core pre-release is published, follow-up PRs will: - update the `Testably.Abstractions.Interface` version range and reset the `BuildScope` - implement hard links, `OpenNullHandle` and the generic random methods in `MockFileSystem` and `RandomMock` - add the new .NET 11 compression APIs (password and encryption support, `ZipExtractionOptions`, `ZipFileCreationOptions`, `IZipArchiveEntry.Open(FileAccess)` and the new entry properties) The parity tests for the compression types and the unit tests of the companion packages on `net11.0` only pass after the mock implementations. In `CoreOnly` the pipeline does not run them.
Test Results 1 files - 61 1 suites - 61 19s ⏱️ - 1h 17m 28s Results for commit ef0f013. ± Comparison against base commit ccf0a5f. This pull request removes 66181 and adds 2 tests. Note that renamed tests count towards both. |
|
This pull request is merged. |
vbreuss
added a commit
that referenced
this pull request
Nov 1, 2026
…kage This PR completes the .NET 11 support from #1176. It consumes the `11.0.0-pre.1` core packages, implements the new members in `MockFileSystem` and `MockRandomSystem`, and mirrors the new zip APIs in the compression package, so that the parity tests pass on `net11.0`. ### Key changes - Updated the `Testably.Abstractions.Interface` version range to `[11.0.0-pre.1,11.1.0)` and reset the `BuildScope` - Implemented the generic random methods in `RandomMock`; configured generators are used for `int`, `long`, `float` and `double` - `IRandom.NextInteger<T>()`, `IRandom.NextInteger<T>(T)`, `IRandom.NextInteger<T>(T, T)` - `IRandom.NextBinaryFloat<T>()` - Added hard link support to `MockFileSystem` (`IFile.CreateHardLink`, `IFileInfo.CreateAsHardLink`) - Each path in the in-memory storage now refers to shared file data (content, attributes, timestamps, Unix file mode), so hard links share content and metadata - `FileShare` locks are kept per file instead of per path, so opening one link without sharing blocks the others - The content and the used drive space are only released when the last link is deleted - `Copy`, `Move` and `Replace` between links of the same file and the exceptions of `CreateHardLink` follow the real behaviour on Windows, Linux and macOS - Added `IFile.OpenNullHandle` to `MockFileSystem`: the handle discards written bytes, returns no data and, like the real handle, only supports seeking on Linux and macOS - Added the new .NET 11 compression APIs, including the mock implementation - `IZipArchive.CreateEntry`, `CreateEntryFromFile` and `CreateEntryFromFileAsync` with a password and `ZipEncryptionMethod` - `IZipArchive.ExtractToDirectory(Async)`, `IZipArchiveEntry.ExtractToFile(Async)` and `IZipFile.ExtractToDirectory(Async)` with `ZipExtractionOptions` - `IZipFile.CreateFromDirectory(Async)` with `ZipFileCreationOptions` - `IZipArchiveEntry.Open(Async)` with `FileAccess` and/or a password, and the properties `CompressionMethod`, `EncryptionMethod` and `VersionMadeBy` - Added tests against the mocks and the real file system, updated the `net11.0` compression API snapshot and listed .NET 11 in the documentation
vbreuss
added a commit
that referenced
this pull request
Nov 1, 2026
…kage (#1177) This PR completes the .NET 11 support from #1176. It consumes the `11.0.0-pre.1` core packages, implements the new members in `MockFileSystem` and `MockRandomSystem`, mirrors the new zip APIs in the compression package, so that the parity tests pass on `net11.0`, and aligns the mocks with behavior changes of the .NET 11 runtime. ### Key changes - Updated the `Testably.Abstractions.Interface` version range to `[11.0.0-pre.1,11.1.0)` and reset the `BuildScope` - Implemented the generic random methods in `RandomMock`; configured generators are used for `int`, `long`, `float` and `double` - `IRandom.NextInteger<T>()`, `IRandom.NextInteger<T>(T)`, `IRandom.NextInteger<T>(T, T)` - `IRandom.NextBinaryFloat<T>()` - Added hard link support to `MockFileSystem` (`IFile.CreateHardLink`, `IFileInfo.CreateAsHardLink`) - Each path in the in-memory storage now refers to shared file data (content, attributes, timestamps, Unix file mode), so hard links share content and metadata - `FileShare` locks are kept per file instead of per path, so opening one link without sharing blocks the others - The content and the used drive space are only released when the last link is deleted - `Copy`, `Move` and `Replace` between links of the same file and the exceptions of `CreateHardLink` follow the real behavior on Windows, Linux and macOS, including the rejection of `<`, `>` and `"` in either path on Windows - Added `IFile.OpenNullHandle` to `MockFileSystem`: the handle discards written bytes, returns no data and, like the real handle, only supports seeking on Linux and macOS - Added the new .NET 11 compression APIs, including the mock implementation - `IZipArchive.CreateEntry`, `CreateEntryFromFile` and `CreateEntryFromFileAsync` with a password and `ZipEncryptionMethod` - `IZipArchive.ExtractToDirectory(Async)`, `IZipArchiveEntry.ExtractToFile(Async)` and `IZipFile.ExtractToDirectory(Async)` with `ZipExtractionOptions` - `IZipFile.CreateFromDirectory(Async)` with `ZipFileCreationOptions` - `IZipArchiveEntry.Open(Async)` with `FileAccess` and/or a password, and the properties `CompressionMethod`, `EncryptionMethod` and `VersionMadeBy` - Aligned the mocks on `net11.0` with behavior changes of the .NET 11 runtime that showed up in CI - `IFileInfo.Open`, `OpenRead`, `OpenWrite` and `OpenText` invalidate the cached state, like `Create` already did - On Linux and macOS, file streams are never asynchronous, because Unix opens regular files without `O_NONBLOCK` - A stream created from a handle follows the handle and ignores the `isAsync` argument - On Linux and macOS, `CreateHardLink` with a missing target throws a `DirectoryNotFoundException` when the link path has no directory part, because the runtime only checks the parent of the path as passed - On Linux and macOS, `ITimer.Dispose(WaitHandle)` with a `Mutex` or `Semaphore` disposes the timer and then throws an `InvalidOperationException` - Added tests against the mocks and the real file system, updated the `net11.0` compression API snapshot and listed .NET 11 in the documentation
|
This is addressed in release v8.0.0. |
This was referenced Nov 11, 2026
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.
This PR adds
net11.0as a target framework and mirrors the new .NET 11 APIs in the core abstractions. It is the first of two steps: the core packages need to be released as a pre-release (11.0.0-pre.1) before the main packages can implement the new members, because they consumeTestably.Abstractions.Interfaceas a NuGet package.Key changes
net11.0target framework to the source and test projects and pinned the .NET 11 SDK (11.0.100-rc.3.26522.148) inglobal.json. The workflows install it viaglobal-json-file, so moving to the final release only needs a change inglobal.json.FEATURE_FILESYSTEM_HARDLINK,FEATURE_FILE_OPENNULLHANDLEandFEATURE_RANDOM_GENERICIFile.CreateHardLink(string, string)IFile.OpenNullHandle()IFileInfo.CreateAsHardLink(string)IRandom.NextInteger<T>()IRandom.NextInteger<T>(T)IRandom.NextInteger<T>(T, T)IRandom.NextBinaryFloat<T>()Net11ParityTestsand thenet11.0API snapshotsBuildScopetoCoreOnly, so that only the core packages are built and publishedFollow-up
After the core pre-release is published, follow-up PRs will:
Testably.Abstractions.Interfaceversion range and reset theBuildScopeOpenNullHandleand the generic random methods inMockFileSystemandRandomMockZipExtractionOptions,ZipFileCreationOptions,IZipArchiveEntry.Open(FileAccess)and the new entry properties)The parity tests for the compression types and the unit tests of the companion packages on
net11.0only pass after the mock implementations. InCoreOnlythe pipeline does not run them.