Test initilization with TCAReducer #125
Replies: 2 comments 2 replies
-
Hi @grahamhindle, can you reproduce this problem in a minimal project and share it? The info provided isn't enough for me to know what is going on. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I’m almost certain now that it is a problem with crest. I have 15 modules , and there seems to be a problem with the test. It’s only at the target level. When I run a test suite using tca with sharinggrdb, all the tests run. In every module, no matter if I have complex queries in the feature. It I’ve tried to run from Tuist, swift test, removed the fetch. I’ve tried swift 6.1,6.1.2, 6.2 with iOS 18.4, 18.5, 18.6, iOS 26.0, but all gave the same resultI’ve created a smaller app, with a framework, and my database framework which I will send you. I’ve tried a number of Tuist versions as wellThanks for your support and I am making extensive use of SharingGRDB. It’s a great library Sent from my iPhoneOn 14 Aug 2025, at 15:54, Brandon Williams ***@***.***> wrote:
Hi @grahamhindle, can you reproduce this problem in a minimal project and share it? The info provided isn't enough for me to know what is going on.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i have a @fetchall in my struct
@ObservableState
public struct State: Equatable, Sendable {
@ObservationStateIgnored
@fetchall(
Avatar
.order(by: .dateCreated)
.limit(10)
.select { PopularAvatar.Columns(avatar: $0) }
)
var popularAvatarRecords: [PopularAvatar] = []
and a testfile that initilizes a test database
@suite(
.dependencies {
$0.date.now = baseDate
$0.context = .test
$0.defaultDatabase = try appDatabase()
try $0.defaultDatabase.write { try $0.seedTestData() }
}
)
a test
extension BaseTestSuite {
@mainactor
struct AvatarFeatureTests {
@test func getRecords() async throws {
}
when i run individual tests - all is good, and the tests run as expected. However, if i exercise the individual tests, or the suite all works fine, but if i exercise the whole test target, even with just one suite, i get an exception.
The 'xcodebuild' command exited with error code 65 and message:
2025-08-14 08:43:36.060 xcodebuild[15510:4376109] [MT] IDETestOperationsObserverDebug: 15.623 elapsed --
Testing started completed.
2025-08-14 08:43:36.060 xcodebuild[15510:4376109] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000
sec -- start
2025-08-14 08:43:36.060 xcodebuild[15510:4376109] [MT] IDETestOperationsObserverDebug: 15.623 sec, +15.623
sec -- end
Testing failed:
xctest (15843) encountered an error (Early unexpected exit, operation never finished bootstrapping - no
restart will be attempted. (Underlying Error: Crash: xctest (15843) ))
** TEST FAILED **
any help in understanding this would be helpful. My theory is that the store is initialized before the database is initialized and seeded.
Beta Was this translation helpful? Give feedback.
All reactions