Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,18 @@ than literals for this reason.

**BEAM was unblocked by Fable 5.13.0** (`fix(beam)` #4849 made reflection value access agree with
record *and union* codegen — `PropertyInfo.GetValue` / `FSharpValue.MakeRecord` / `MakeUnion` no
longer `{badkey,...}`). Remoting now runs on all three targets. Two BEAM-specific notes remain:
longer `{badkey,...}`). Remoting now runs on all three targets. One BEAM-specific note remains:

- Reflection reports the pristine F# field name, not the record-map key, so `getJsonMember`
reproduces `sanitizeFieldName` via `toWireKey` (see above). The Fable team **declined** to change
the BEAM reflection surface or wire format (neither is needed for reflection correctness), so
`toWireKey` is the **sanctioned** integration point — not a temporary shim to delete. `sanitizeFieldName`
is stable; if it ever changes, the wire key is treated as contract. Background in
`../Fable/BEAM-RECORD-FIELD-NAME-MANGLING-PROMPT.md`.
- The BEAM test runner wraps the suites in `testSequenced` (`test/beam/Main.fs`): every remoting test
passes in isolation, but under Quill's default cross-suite concurrency on BEAM the body assertions
intermittently fail with a garbled diff. This is a Scriptorium/BEAM concurrency+rendering gap
(Scriptorium PRs #13/#15); revert to plain parallel `runTests` once they release — tracked in
issue #54.

The BEAM `testSequenced` workaround is **gone** (issue #54 closed): Quill 0.5.1 (Unicode output on
BEAM, Scriptorium #14) and Nib 0.4.1 (char-level diffs on BEAM, #15) fixed the garbled-diff failures,
so `test/beam/Main.fs` runs the three suites with plain parallel `runTests` like the other targets.

**Python tripwire on the next `fable-library-py` bump.** The Fable team is fixing Python reflection to
report the *pristine* F# field name (like BEAM) while keeping the snake_case runtime slot
Expand Down Expand Up @@ -150,7 +149,7 @@ One behavioral suite in `test/shared/` (`HandlerTests.fs`, `RoutingTests.fs`) is
per-target projects — `test/python`, `test/js`, `test/beam` — each supplying its own `TestContext.fs`
(a `TestContext.create` factory building an isolated context without a real server) and a thin
`Main.fs` entry point. `RemotingTests.fs` runs on all three targets as of Fable 5.13.0 (see the
Remoting note below for the two BEAM-specific caveats: `toWireKey` and the `testSequenced` runner).
Remoting note below for the remaining BEAM-specific caveat: `toWireKey`).

Tests are written with [Scriptorium](https://github.com/fable-hub/Scriptorium) — Quill for the test
DSL and runner, Nib for assertions — both of which compile to all three targets. `test/shared/Helpers.fs`
Expand Down
4 changes: 2 additions & 2 deletions test/beam/Fable.Giraffe.Tests.Beam.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fable.Core" Version="5.2.0" />
<PackageReference Include="Scriptorium.Quill" Version="0.5.0" />
<PackageReference Include="Scriptorium.Nib" Version="0.4.0" />
<PackageReference Include="Scriptorium.Quill" Version="0.5.1" />
<PackageReference Include="Scriptorium.Nib" Version="0.4.1" />
<PackageReference Include="Fable.Beam" Version="5.0.0-rc.33" />
<PackageReference Include="Fable.Beam.Cowboy" Version="5.0.0-rc.24" />
</ItemGroup>
Expand Down
10 changes: 1 addition & 9 deletions test/beam/Main.fs
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
module Fable.Giraffe.Tests.Main

open type Scriptorium.Quill.Runner
open type Scriptorium.Quill.Test

// BEAM runner. Quill runs the suite synchronously here and calls `halt/1` with the exit code, so
// `erl` returns non-zero when tests fail. Fable >= 5.8 namespaces generated BEAM modules and emits
// a `main.erl` shim that dispatches to [<EntryPoint>], so the entry point keeps the runner findable
// across Fable versions.
//
// The three suites are wrapped in `testSequenced` so they run one-suite-at-a-time rather than all
// interleaved. Every remoting test passes on its own and the suite passes when run in isolation, but
// under Quill's default cross-suite concurrency on BEAM the remoting body assertions intermittently
// fail with a garbled diff (rendered as "1"). That is a Scriptorium/BEAM concurrency+rendering gap
// tracked in Scriptorium PRs #13 (Quill 0.5.1 Unicode output) and #15 (Nib char-level diffs); once
// those release, drop back to a plain parallel `runTests [ ...; RemotingTests.tests ]`. See #54.
[<EntryPoint>]
let main _ =
runTests [ testSequenced ("suite", [ HandlerTests.tests; RoutingTests.tests; RemotingTests.tests ]) ]
runTests [ HandlerTests.tests; RoutingTests.tests; RemotingTests.tests ]
4 changes: 2 additions & 2 deletions test/js/Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fable.Core" Version="5.2.0" />
<PackageReference Include="Scriptorium.Quill" Version="0.5.0" />
<PackageReference Include="Scriptorium.Nib" Version="0.4.0" />
<PackageReference Include="Scriptorium.Quill" Version="0.5.1" />
<PackageReference Include="Scriptorium.Nib" Version="0.4.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\js\Fable.Giraffe.Js.fsproj" />
Expand Down
4 changes: 2 additions & 2 deletions test/python/Fable.Giraffe.Tests.Python.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Scriptorium.Quill" Version="0.5.0" />
<PackageReference Include="Scriptorium.Nib" Version="0.4.0" />
<PackageReference Include="Scriptorium.Quill" Version="0.5.1" />
<PackageReference Include="Scriptorium.Nib" Version="0.4.1" />
</ItemGroup>

<ItemGroup>
Expand Down