Skip to content

Functionally smoke-test each native in CI (load + open a PDF) - #17

Merged
Frooodle merged 3 commits into
mainfrom
feat/ci-native-smoke
Jun 17, 2026
Merged

Functionally smoke-test each native in CI (load + open a PDF)#17
Frooodle merged 3 commits into
mainfrom
feat/ci-native-smoke

Conversation

@Frooodle

Copy link
Copy Markdown
Member

Problem

The natives are never functionally tested in CI. Per-platform jobs in snapshot.yml / publish-github-packages.yml build the real bridge and then only check the output dir is non-empty (test -n "$(ls -A native/dist/...)"); ci.yml builds a stub and compile-checks. The real integration tests are gated behind -Djpdfium.integration=true and never run in CI. So a native that builds but can't load (missing dep, bad libc, ABI break) ships green.

Change

Functionally smoke-test each freshly-built native through the production load path:

  • NativeSmokeTest - loads the native via NativeLoader and opens a real PDF (PdfDocument.openpageCount() >= 1). Gated on -Djpdfium.smoke=true so it only runs where a matching native is present (not in the stub PR build).
  • nativeSmokeTest gradle task + a platform-selectable test native: testRuntimeOnly now honors -Pjpdfium.testNatives=<platform> (default linux-x64), so each CI job loads the native it just built instead of always linux-x64.
  • snapshot.yml + publish-github-packages.yml: after bundling, install jextract and run :jpdfium:nativeSmokeTest -Pjpdfium.testNatives=<platform>. Covers linux-x64, linux-arm64, darwin-arm64, windows-x64. darwin-x64 is skipped (cross-compiled on an arm64 host, so the x64 native can't execute there) and keeps the file-exists check.

Validation

Ran the new task locally on a real host (Windows x64), staging the published windows native into native/dist/windows-x64/:

> Task :jpdfium:nativeSmokeTest
tests="1" skipped="0" failures="0" errors="0"
loadsNativeAndOpensPdf  PASSED (0.89s)

So the production load path + PDF open is exercised, not just "a file exists". The other platforms run the same task on their own native runner in CI.

Note: this is independent of the musl PR (#16); once both land, musl gets the same smoke for free via -Pjpdfium.testNatives=linux-musl-*.

@Frooodle
Frooodle merged commit cef2c74 into main Jun 17, 2026
4 checks passed
@Frooodle
Frooodle deleted the feat/ci-native-smoke branch June 17, 2026 13:35
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