diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-21 00:58:15 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-21 00:58:15 +0800 |
| commit | 7b29dbff7e43e87741476f47df17ad1582b16546 (patch) | |
| tree | 4c9d0832b4e4edd77e59e9cb0a88abf5e729a9f9 /tests/SomhairlesDream.Shared.Tests/FrontendContractTests.fs | |
| parent | 47add3088d50f12c5f48591f26c53cdb59d8283b (diff) | |
| download | somhairles-dream-fsharp-7b29dbff7e43e87741476f47df17ad1582b16546.tar.gz | |
feat(pipeline): add runnable artifact pipeline increment
[Change Nature]
- This commit adds the first runnable increment of the F# artifact
pipeline: CLI, server, frontend bundle, stage fixture, and tests.
It is feature work, not a bug fix.
[New Capability]
- CLI `run` executes the three-step Blender fixture through the process
bridge and writes GLBs, step logs, events, and a manifest; `verify`
validates a manifest without Blender.
- Server exposes run start, run-scoped SSE, artifact manifest/file
routes, and serves the Fable frontend from its build output.
- Frontend starts runs, follows run-scoped SSE progress, and links the
artifact manifest on completion.
[Implementation]
- Shared layer holds domain, run state, replay, and artifact contracts;
Modeling holds the pipeline, 120s bridge timeout, and result-file
protocol; stage/blender/fixture.py owns geometry in Python (bpy owns
geometry, F# owns orchestration).
- Fable bundle is regenerated into public/ and copied by the server
project; solution includes all projects with warnings-as-errors.
- README documents build, Fable, server, interpreter/env, fixture
limitations, and current verification status.
[Impact]
- Verified: 40/40 solution tests pass; Release build 0 warnings/errors;
real CLI run with bpy 5.0.1 produced 3 GLBs, 3 logs, and a
verify-clean manifest; isolated-port server smoke flow succeeded.
- Not yet verified: browser end-to-end behavior and production
fidelity. Artifacts and caches are gitignored.
Diffstat (limited to 'tests/SomhairlesDream.Shared.Tests/FrontendContractTests.fs')
| -rw-r--r-- | tests/SomhairlesDream.Shared.Tests/FrontendContractTests.fs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/SomhairlesDream.Shared.Tests/FrontendContractTests.fs b/tests/SomhairlesDream.Shared.Tests/FrontendContractTests.fs new file mode 100644 index 0000000..d961d8b --- /dev/null +++ b/tests/SomhairlesDream.Shared.Tests/FrontendContractTests.fs @@ -0,0 +1,36 @@ +module SomhairlesDream.Shared.Tests.FrontendContractTests + +open System.IO +open Xunit + +let private root = Path.GetFullPath(Path.Combine(__SOURCE_DIRECTORY__, "..", "..")) + +let private readRelative path = File.ReadAllText(Path.Combine(root, path)) + +let private assertBrowserContract contents = + Assert.Contains("/api/runs/start", contents) + Assert.Contains("/api/runs/events?projectId=", contents) + Assert.Contains("artifact-manifest-link", contents) + Assert.DoesNotContain("/api/events", contents) + +[<Fact>] +let ``frontend source and bundle use the selected artifact run lifecycle`` () = + readRelative "src/SomhairlesDream.Frontend/App.fs" + |> assertBrowserContract + + readRelative "public/App.js" + |> assertBrowserContract + + let html = readRelative "public/index.html" + Assert.Contains("id=\"run-start-button\"", html) + Assert.Contains("id=\"artifact-manifest-link\"", html) + +[<Fact>] +let ``solution contains every project in the artifact pipeline`` () = + let solution = readRelative "SomhairlesDream.sln" + + [ "SomhairlesDream.Modeling" + "SomhairlesDream.Cli" + "SomhairlesDream.Modeling.Tests" + "SomhairlesDream.Cli.Tests" ] + |> List.iter (fun project -> Assert.Contains(project, solution)) |
