Repository navigation
Add native smoke test for JabSrv - #16822
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR Summary by QodoAdd JabSrv native-image smoke testing and headless fallback
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1.
|
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
JabLS and JabSrv native smoke tests now live in one workflow with one job each. The macOS matrix entry is dropped for pull_request and merge_group (same reasoning as JabRef#16784/JabRef#16788: a skipped job still occupies a scarce mac runner), so it only runs on push to main/main-release and workflow_dispatch. The Linux link libraries are installed via the cached apt action, and the Jersey external test container is always on the test runtime classpath since Grizzly stays the default. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MwTYeDrUGGtdpcvTAKV15
|
🤖 Generated with Claude Code Pushed 7594304 and 6283982 to this branch (maintainer edits):
|
The per-component path filters are the point of separate workflows: a jabls-only change must not build the jabsrv native image and vice versa. Both workflows keep the macOS-on-main-only matrix and now pin every action to a commit SHA. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MwTYeDrUGGtdpcvTAKV15
Summary
How it works (the loop):
.bibfiles.-Pjabsrv.native.smoke=<port>. Jersey's test framework can run tests against an external test container, which sends every request to the running binary.Bug the smoke test caught (and this PR fixes):
CAYWResource.isLibraryPathAccessAllowedcallsGraphicsEnvironment.isHeadless(). In the native image the AWT native libraries (e.g.libawt_lwawt.dylibon macOS) are not bundled, so that call throwsUnsatisfiedLinkErrorand the endpoint returns 500 for an unknown library path.Fixed by treating an unavailable AWT as headless.
Files:
jabsrv/build.gradle.kts: add thenativeSmokeTesttask (external-container system properties + read the exclude list).gradle/modules.properties: map the Jersey external test-framework provider module.jabsrv/src/test/nativeimage/smoke-excluded-tests.txt: the excluded tests..github/workflows/jabsrv-native-smoke-test.yml: CI workflow.jabsrv/src/main/java/org/jabref/http/server/cayw/CAYWResource.java: guardisHeadless()so an unavailable AWT is treated as headless (the native fix above).Steps to test
Build the native binary with a Liberica NIK Full JDK:
Expected:
BUILD SUCCESSFUL. The reused *ResourceTest classes pass against the native binary; the headless / GUI-only tests in smoke-excluded-tests.txt are skipped.Related issues and pull requests
Closes NA
This PR is part of the JabRef components as native images project.
Follow-up to #16565
AI usage
claude-opus-4-8
AI CHECKLIST.md walkthrough
Checklist
CHANGELOG.mddescribing the change from the user's point of view (if the change is visible to the user)