pointfreeco / swift-snapshot-testing

📸 Delightful Swift snapshot testing.
https://www.pointfree.co/episodes/ep41-a-tour-of-snapshot-testing
MIT License
3.74k stars 570 forks source link

Crash when trying to use inline snapshots with swift testing with project that reproduces issue #883

Closed doozMen closed 1 month ago

doozMen commented 1 month ago

Describe the bug I try to run tests to update an inline snapshot from withing swift testing. This gives the crash in the screenshot

Weird thing is that swift test --enable-swift-testing works, so I'm somehow lost. I thing it has to do with that it when running the Swift Testing tests tries to access the XCTContext which Swift Testing does not have ...

To Reproduce Checkout the project https://doozMen@github.com/doozMen/swift-snapshot-testing-cli.git and run the test with xcode 16 beta 4 and you will have the crash.

Expected behavior not crash Screenshots

Screenshot 2024-08-01 at 22 10 41

Environment

{
  "originHash" : "35a4a32a5c0f09cd68c0775649a65152e4d6c65278f8c13bcdb4765503ab464b",
  "pins" : [
    {
      "identity" : "swift-snapshot-testing",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/pointfreeco/swift-snapshot-testing",
      "state" : {
        "revision" : "c097f955b4e724690f0fc8ffb7a6d4b881c9c4e3",
        "version" : "1.17.2"
      }
    },
    {
      "identity" : "swift-syntax",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/swiftlang/swift-syntax",
      "state" : {
        "revision" : "06b5cdc432e93b60e3bdf53aff2857c6b312991a",
        "version" : "600.0.0-prerelease-2024-07-30"
      }
    }
  ],
  "version" : 3
}

Additional context Add any more context about the problem here.

mbrandonw commented 1 month ago

Hey @doozMen, thanks for the report! #884 should fix it.