Skip to content

Fix cross language tests at least on macOS - #8

Merged
ksugar merged 2 commits into
mainfrom
fix-cross-language-tests
Jul 17, 2026
Merged

Fix cross language tests at least on macOS#8
ksugar merged 2 commits into
mainfrom
fix-cross-language-tests

Conversation

@tinevez

@tinevez tinevez commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Two issues prevented the Python/Java round-trip tests from running at all.

mvn package produced no runnable jar

The pom.xml had no maven-assembly-plugin, so mvn package only wrote compiled classes to target/classes/ with no dependency JARs alongside them. The test runner looks for a *-jar-with-dependencies.jar
first; without it, it fell back to target/classes/ alone, leaving n5, n5-zarr, imglib2 and friends off the classpath. Every test failed immediately with NoClassDefFoundError: org/janelia/saalfeldlab/n5/N5Reader.

Fix: add maven-assembly-plugin to the build profile so mvn package also produces target/geff-*-jar-with-dependencies.jar.

Blosc native library was never found

JNA (used by n5-blosc to load libblosc) ignores -Djava.library.path and uses its own -Djna.library.path property instead. The test runner was passing the wrong property, so even with c-blosc correctly installed
via Homebrew, JNA could not locate libblosc.dylib and every run crashed with UnsatisfiedLinkError.

Fix: pass -Djna.library.path in run_tests.py, consistent with how the Maven Surefire config already does it in pom.xml.

Done with the help of Claude Sonnet to make sense of the error, and @tpietzsch

tinevez added 2 commits July 16, 2026 09:40
mvn package only produced target/classes/ with no dependency JARs.
The cross-language test runner looks for a *-jar-with-dependencies.jar
first; without it, it fell back to target/classes/ alone, leaving
n5, n5-zarr, imglib2, etc. off the classpath at runtime.

Done with the help of Claude Sonnet and Tobias Pietzsch.
JNA ignores -Djava.library.path and uses its own -Djna.library.path
property to locate native libraries. The cross-language test runner
was passing the wrong property, so libblosc.dylib was never found
regardless of whether c-blosc was installed via homebrew.

Again, Claude and Tobias
@tinevez
tinevez requested a review from ksugar July 16, 2026 07:42
@ksugar
ksugar merged commit f8433cf into main Jul 17, 2026
1 check passed
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.

2 participants