Open
Conversation
4a09d9d to
990146b
Compare
990146b to
e8b34f3
Compare
Saczuu
approved these changes
May 6, 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.
Updates to support swift-testing for parallelized testing. Plan to version
4.0.0because I can't guarantee the changes to the mocks won't affect someone in an inconvenient way.This pull request introduces a new
SubprocessTestinglibrary for improved subprocess mocking in Swift Testing, makes several enhancements to concurrency and parallel test safety, and updates documentation and package configuration accordingly. The main focus is to enable safe, parallelizable subprocess mocking in tests by leveraging@TaskLocal, and to modernize the codebase for Swift 5.10 and improved Sendable compliance.Testing and Mocking Improvements:
SubprocessTestinglibrary target, providingSubprocessTrait(a Swift TestingTestTrait/SuiteTrait) that scopes subprocess mocking to each test via@TaskLocal, enabling safe parallel test execution. A newSwiftTestingtest target demonstrates parallel mock usage. [1] [2] [3] [4] [5]Concurrency and Sendable Compliance:
SubprocessDependencyFactorynow conforms toSendable, andMockSubprocessDependencyBuilderis nowpublic finalandSendable. Itssharedinstance is now managed by@TaskLocalinstead of an unsafe static, removing the need for manual resets between tests. [1] [2]MockProcess.Context, itsState,ExpectationError, andMockSubprocessErrornow conform toSendable. TherunStubclosure is now@Sendable, and standard I/O properties inMockProcess.Contextare markednonisolated(unsafe)for Sendable conformance. [1] [2]API and Testing Usability:
MockSubprocessDependencyBuilder.makeProcess,makeInputFileHandle, andmakeInputPipeare nowpublicto support the new testing target.Shell.expectandSubprocess.expectoverloads now use#filePathinstead of#filefor the defaultfile:argument, improving diagnostics. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Documentation and Package Updates:
README.mdwith new instructions and examples for usingSubprocessTesting, including parallel test examples.swift-tools-versionto 5.10 and updated the changelog for version 4.0.0. [1] [2]These changes modernize the subprocess mocking infrastructure, making it safer and more ergonomic for concurrent and parallel Swift Testing.