Skip to content
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

Fix assertSnapshot for Swift Testing tests. #916

Merged
merged 3 commits into from
Oct 8, 2024
Merged

Conversation

mbrandonw
Copy link
Member

Fixes #915

Comment on lines -4 to -6
@_implementationOnly import Testing
import Testing

@_spi(Experimental)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up @JRR-OSU and @kondratk. This will affect you based on our discussions in #901.

We have had to remove the @_implementationOnly imports for Testing because we want to remove the @_spi restriction from these testing traits. This means that once again Snapshot Testing will not work from UI testing targets. Again, we feel this is a bug for Apple to deal with, as Testing does not work in UI test targets.

The only other fix that comes to mind for this would be to move everything but the code that uses Swift Testing into some kind of "SnapshotTestingCore" module, and then that could be imported into UI test targets when needed. We will discuss this more.

@mbrandonw mbrandonw merged commit fb739f2 into main Oct 8, 2024
4 checks passed
@mbrandonw mbrandonw deleted the fix-swift-testing branch October 8, 2024 17:05
@IlyaPuchkaTW
Copy link

IlyaPuchkaTW commented Oct 17, 2024

Does this mean that attachments won't be available at all when running from Swift Testing? Seems like Swift Testing does not support it yet at all?

@stephencelis
Copy link
Member

@IlyaPuchkaTW That's correct. You can follow their progress here: swiftlang/swift-testing#714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash Current context must not be nil with swift-testing
3 participants