Functionally smoke-test each native in CI (load + open a PDF) - #17
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The natives are never functionally tested in CI. Per-platform jobs in
snapshot.yml/publish-github-packages.ymlbuild the real bridge and then only check the output dir is non-empty (test -n "$(ls -A native/dist/...)");ci.ymlbuilds a stub and compile-checks. The real integration tests are gated behind-Djpdfium.integration=trueand 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 viaNativeLoaderand opens a real PDF (PdfDocument.open→pageCount() >= 1). Gated on-Djpdfium.smoke=trueso it only runs where a matching native is present (not in the stub PR build).nativeSmokeTestgradle task + a platform-selectable test native:testRuntimeOnlynow honors-Pjpdfium.testNatives=<platform>(defaultlinux-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-x64is 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/: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-*.