polscm32 1 год назад
Родитель
Сommit
8e663c1ecf

+ 1 - 1
TrioTests/BolusCalculatorTests/BolusCalculatorTests.swift

@@ -3,7 +3,7 @@ import Testing
 
 @testable import Trio
 
-@Suite(.serialized) struct BolusCalculatorTests: Injectable {
+@Suite("Bolus Calculator Tests") struct BolusCalculatorTests: Injectable {
     @Injected() var calculator: BolusCalculationManager!
     @Injected() var settingsManager: SettingsManager!
     @Injected() var fileStorage: FileStorage!

+ 1 - 1
TrioTests/CoreDataTests/DeterminationStorageTests.swift

@@ -5,7 +5,7 @@ import Testing
 
 @testable import Trio
 
-@Suite(.serialized) struct DeterminationStorageTests: Injectable {
+@Suite("Determination Storage Tests") struct DeterminationStorageTests: Injectable {
     @Injected() var storage: DeterminationStorage!
     let resolver: Resolver
     let coreDataStack = CoreDataStack.createForTests()

+ 2 - 9
TrioTests/CoreDataTests/PumpHistoryStorageTests.swift

@@ -6,7 +6,7 @@ import Testing
 @testable import LoopKit
 @testable import Trio
 
-@Suite(.serialized) struct PumpHistoryStorageTests: Injectable {
+@Suite("PumpHistoryStorage Tests") struct PumpHistoryStorageTests: Injectable {
     @Injected() var storage: PumpHistoryStorage!
     let resolver: Resolver
     let coreDataStack = CoreDataStack.createForTests()
@@ -15,8 +15,6 @@ import Testing
 
     init() {
         // Create test context
-        // As we are only using this single test context to initialize our in-memory PumpHistoryStorage we need to perform the Unit Tests serialized
-        // TODO: is this really correct or does PersistentHistoryTracking also work in this in memory Coredata stack. This would allow me to use a single test context per test and perform the tests in parallel!
         testContext = coreDataStack.newTaskContext()
 
         // Create assembler with test assembly
@@ -75,9 +73,8 @@ import Testing
             )
         ]
 
-        // Store test event and wait for storage to complete the task
+        // Store test event
         await storage.storePumpEvents(events)
-//        try await Task.sleep(nanoseconds: 1_000_000_000)
 
         // When - Fetch events with our generic fetch function
         let fetchedEvents = await coreDataStack.fetchEntitiesAsync(
@@ -189,9 +186,6 @@ import Testing
         // Store in our in-memory PumphistoryStorage
         await storage.storePumpEvents(events)
 
-        // Wait for the events to be stored
-//        try await Task.sleep(nanoseconds: 1_000_000_000)
-
         // Then
         // Fetch all events after storing
         let finalEntries = try await testContext.perform {
@@ -260,7 +254,6 @@ import Testing
 
         // Store test event and wait for storage to complete the task
         await storage.storePumpEvents(events)
-//        try await Task.sleep(nanoseconds: 1_000_000_000)
 
         // When - Fetch events with our generic fetch function
         let fetchedEvents = await coreDataStack.fetchEntitiesAsync(