From b4d16b969745454c9203fdd089347fedeb90e597 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 13 Jun 2026 16:05:15 +0000 Subject: [PATCH] Fix RerankingModelTest to skip when reranking model is absent The @BeforeAll setup() called new LlamaModel() unconditionally, which triggered LlamaLoader.initialize() -> UnsatisfiedLinkError on CI runners without the native library, causing the test class to error rather than skip. Add Assumptions.assumeTrue(model file exists) before the LlamaModel constructor, matching the skip guard pattern used in LlamaEmbeddingsTest. https://claude.ai/code/session_01VhZPQjHAWvrq7Hd3mDz57C --- src/test/java/net/ladenthin/llama/RerankingModelTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/net/ladenthin/llama/RerankingModelTest.java b/src/test/java/net/ladenthin/llama/RerankingModelTest.java index 937aa5a5..b6f11776 100644 --- a/src/test/java/net/ladenthin/llama/RerankingModelTest.java +++ b/src/test/java/net/ladenthin/llama/RerankingModelTest.java @@ -7,12 +7,14 @@ import static org.junit.jupiter.api.Assertions.*; +import java.io.File; import java.util.List; import java.util.Map; import net.ladenthin.llama.parameters.ModelParameters; import net.ladenthin.llama.value.LlamaOutput; import net.ladenthin.llama.value.Pair; import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -30,6 +32,9 @@ public class RerankingModelTest { @BeforeAll public static void setup() { + Assumptions.assumeTrue( + new File("models/jina-reranker-v1-tiny-en-Q4_0.gguf").exists(), + "Reranking model not available, skipping tests"); int gpuLayers = Integer.getInteger(TestConstants.PROP_TEST_NGL, TestConstants.DEFAULT_TEST_NGL); model = new LlamaModel(new ModelParameters() .setCtxSize(128)