A (somewhat brittle) solution for anyone that finds this via Google.
After running a build with swift build I manually invoke the momc compiler to produce the necessary momd and save it to the SPM generated bundle. After that I execute the tests.
swift build
/Applications/Xcode.app/Contents/Developer/usr/bin/momc Sources/PackageName/Resources/ModelName.xcdatamodeld .build/arm64-apple-macosx/debug/PackageName_PackageName.bundle/ModelName.momd
swift test
Post
Replies
Boosts
Views
Activity
Xcode 14.3, this is still magically the fix. Thanks DanDolog!