From 9bf17f44afb5e22211b600b16704a6edca8da5f3 Mon Sep 17 00:00:00 2001 From: davotoula Date: Thu, 7 May 2026 21:46:57 +0200 Subject: [PATCH] test(nests): skip JvmOpusRoundTripTest when libopus natives are unavailable club.minnced:opus-java doesn't ship natives for darwin-aarch64, so the sine-440 round-trip test failed on Apple Silicon dev machines and blocked the pre-push hook. Catch the IllegalStateException from encoder/decoder construction and use JUnit Assume to skip; Linux x86_64 CI keeps coverage. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../nestsclient/audio/JvmOpusRoundTripTest.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/nestsClient/src/jvmTest/kotlin/com/vitorpamplona/nestsclient/audio/JvmOpusRoundTripTest.kt b/nestsClient/src/jvmTest/kotlin/com/vitorpamplona/nestsclient/audio/JvmOpusRoundTripTest.kt index 2a1cce492..161f1975a 100644 --- a/nestsClient/src/jvmTest/kotlin/com/vitorpamplona/nestsclient/audio/JvmOpusRoundTripTest.kt +++ b/nestsClient/src/jvmTest/kotlin/com/vitorpamplona/nestsclient/audio/JvmOpusRoundTripTest.kt @@ -21,6 +21,7 @@ package com.vitorpamplona.nestsclient.audio import kotlinx.coroutines.runBlocking +import org.junit.Assume.assumeTrue import kotlin.test.Test /** @@ -37,8 +38,18 @@ class JvmOpusRoundTripTest { @Test fun sine_440_round_trips_through_libopus() { val capture = SineWaveAudioCapture(freqHz = 440) - val encoder = JvmOpusEncoder() - val decoder = JvmOpusDecoder() + // club.minnced:opus-java doesn't ship natives for darwin-aarch64 (Apple + // Silicon). Skip rather than fail so dev machines without a usable + // native still pass the pre-push hook; Linux x86_64 CI keeps coverage. + val encoder: JvmOpusEncoder + val decoder: JvmOpusDecoder + try { + encoder = JvmOpusEncoder() + decoder = JvmOpusDecoder() + } catch (e: IllegalStateException) { + assumeTrue("Opus natives not available: ${e.message}", false) + return + } try { val decoded = mutableListOf() runBlocking {