diff options
Diffstat (limited to 'tests/SomhairlesDream.Server.Tests/StoreTests.fs')
| -rw-r--r-- | tests/SomhairlesDream.Server.Tests/StoreTests.fs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/SomhairlesDream.Server.Tests/StoreTests.fs b/tests/SomhairlesDream.Server.Tests/StoreTests.fs index 4aec16f..5ef2cba 100644 --- a/tests/SomhairlesDream.Server.Tests/StoreTests.fs +++ b/tests/SomhairlesDream.Server.Tests/StoreTests.fs @@ -90,6 +90,38 @@ module StoreTests = Assert.False(snapshot.IsStale) [<Fact>] + let ``artifact store accumulates completed step artifact paths`` () = + let store = ArtifactRunStore(artifactIds, TimeSpan.FromSeconds 15., at 9) + + store.Apply( + RunEvent.Start + { Ids = artifactIds + At = at 9 + TotalSteps = 2 } + ) + |> ignore + + Assert.Empty(store.Snapshot().CompletedSteps) + + for index, stepId in [| 0, "01-foundation"; 1, "02-frame" |] do + store.Apply( + RunEvent.Checkpoint + { Ids = artifactIds + At = at 9 + StepId = stepId + StepIndex = index + TotalSteps = 2 + Message = "artifact verified" + ArtifactPath = $"steps/{stepId}.glb" } + ) + |> ignore + + Assert.Equal<string array>( + [| "steps/01-foundation.glb"; "steps/02-frame.glb" |], + store.Snapshot().CompletedSteps + ) + + [<Fact>] let ``artifact store derives staleness without changing lifecycle status`` () = let store = ArtifactRunStore(artifactIds, TimeSpan.FromSeconds 15., at 9) |
