Skip to content

ci(python): run fable-library-py native tests in build workflow#4820

Merged
dbrattli merged 1 commit into
mainfrom
ci/fable-library-py-tests-in-build
Jul 18, 2026
Merged

ci(python): run fable-library-py native tests in build workflow#4820
dbrattli merged 1 commit into
mainfrom
ci/fable-library-py-tests-in-build

Conversation

@dbrattli

Copy link
Copy Markdown
Collaborator

Problem

The src/fable-library-py/tests suite (247 tests covering fable_library.core, .union, .util — i.e. the Rust extension) ran only in publish-pypi.yml. But that job was never listed in the release job's needs:

release:
  needs: [linux, musllinux, windows, macos, sdist]   # no `test`

So it gated nothing. A failure was invisible until release time and did not stop the publish. It also occupied 9 runners that the wheel jobs were queuing behind, so it cost release wall-clock without buying release safety.

It was also the only place macOS and these native tests were covered at all — build.yml's build-python matrix is [ubuntu, windows] and runs ./build.sh test python, which pytests the transpiled suite in temp/tests/py, not these.

Change

Move the suite to build.yml as test-fable-library-py, keeping the identical [ubuntu, windows, macos] × [3.12, 3.13, 3.14] matrix so no coverage is dropped. It now runs on every push/PR to main, where a break is cheap to catch.

The job is substantially cheaper than the old one:

  • No .NET, no build.sh fable-library --python. These tests import only hand-written, git-tracked sources, never generated ones — so the transpile step and the artifact download are both unnecessary.
  • Extension is built once. The old job ran PyO3/maturin-action and then uv run maturin develop --release, building it twice.
  • uv calls pass --frozen (per AGENTS.md), so a stale uv.lock fails loudly rather than being silently rewritten.

publish-pypi.yml loses the test job, with a comment recording why.

Verification

Both workflows parse, and test was not referenced by any needs, so no dangling edges. Suite runs clean locally:

247 passed in 4.29s

Real confirmation is this PR's own CI — the new job exercising all 9 matrix legs is the thing to watch.

🤖 Generated with Claude Code

The src/fable-library-py/tests suite (fable_library.core, .union, .util)
ran only in publish-pypi.yml, where it was never listed in the `release`
job's `needs`. It therefore gated nothing: a failure was invisible until
release time and did not stop the publish. It also held 9 runners that
the wheel jobs were queuing behind.

Move it to build.yml so it runs on every push/PR to main, keeping the
same [ubuntu, windows, macos] x [3.12, 3.13, 3.14] matrix.

The job needs no .NET and no F# transpilation: these tests import only
hand-written, tracked sources, not generated ones. Dropping the artifact
download also removes the duplicate extension build (maturin-action and
`maturin develop --release` both ran). uv calls pass --frozen so a stale
lock fails instead of being silently rewritten.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dbrattli
dbrattli merged commit 8f9f64f into main Jul 18, 2026
40 checks passed
@dbrattli
dbrattli deleted the ci/fable-library-py-tests-in-build branch July 18, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant