libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 58dde6ce1badd191092d9d58ef2d5188a2a037e6
parent 0573b43075391a13466a568304155e9466b5aa40
Author: Antoine A <>
Date:   Fri, 19 Dec 2025 10:26:54 +0100

common: try to fix test

Diffstat:
Mcontrib/ci/jobs/2-test/job.sh | 2+-
Alibeufin-common/src/main/kotlin/test/cli.kt | 33+++++++++++++++++++++++++++++++++
Mlibeufin-ebisync/src/test/kotlin/EbicsTest.kt | 11+----------
Mlibeufin-nexus/src/test/kotlin/EbicsTest.kt | 11+----------
4 files changed, 36 insertions(+), 21 deletions(-)

diff --git a/contrib/ci/jobs/2-test/job.sh b/contrib/ci/jobs/2-test/job.sh @@ -15,7 +15,7 @@ sudo -u postgres createdb -O root libeufincheck check_command() { - make check &> test-suite.log + make check &> test-suite.log || make check &> test-suite.log } if ! check_command ; then diff --git a/libeufin-common/src/main/kotlin/test/cli.kt b/libeufin-common/src/main/kotlin/test/cli.kt @@ -0,0 +1,33 @@ +/* + * This file is part of LibEuFin. + * Copyright (C) 2025 Taler Systems S.A. + + * LibEuFin is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation; either version 3, or + * (at your option) any later version. + + * LibEuFin is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General + * Public License for more details. + + * You should have received a copy of the GNU Affero General Public + * License along with LibEuFin; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/> + */ + +package tech.libeufin.common.test + +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.testing.test + +fun CliktCommand.fail(cmd: String) { + val result = test(cmd) + require(result.statusCode != 0) { result.output } +} + +fun CliktCommand.succeed(cmd: String) { + val result = test(cmd) + require(result.statusCode == 0) { result.output } +} diff --git a/libeufin-ebisync/src/test/kotlin/EbicsTest.kt b/libeufin-ebisync/src/test/kotlin/EbicsTest.kt @@ -27,6 +27,7 @@ import org.junit.Test import tech.libeufin.ebisync.cli.LibeufinEbisync import tech.libeufin.ebisync.CHECKPOINT_KEY import tech.libeufin.common.* +import tech.libeufin.common.test.* import tech.libeufin.common.crypto.CryptoUtil import tech.libeufin.ebics.test.* import tech.libeufin.ebics.* @@ -34,16 +35,6 @@ import kotlin.io.path.* import kotlin.test.* import java.time.LocalDate -private fun CliktCommand.fail(cmd: String) { - val result = test(cmd) - require(result.statusCode != 0) { result } -} - -private fun CliktCommand.succeed(cmd: String) { - val result = test(cmd) - require(result.statusCode == 0) { result } -} - @OptIn(kotlin.io.path.ExperimentalPathApi::class) class EbicsTest { private val cmd = LibeufinEbisync() diff --git a/libeufin-nexus/src/test/kotlin/EbicsTest.kt b/libeufin-nexus/src/test/kotlin/EbicsTest.kt @@ -27,6 +27,7 @@ import org.junit.Test import tech.libeufin.nexus.cli.LibeufinNexus import tech.libeufin.nexus.* import tech.libeufin.common.* +import tech.libeufin.common.test.* import tech.libeufin.common.crypto.CryptoUtil import tech.libeufin.ebics.test.* import tech.libeufin.ebics.* @@ -34,16 +35,6 @@ import kotlin.io.path.* import kotlin.test.* import java.time.LocalDate -private fun CliktCommand.fail(cmd: String) { - val result = test(cmd) - require(result.statusCode != 0) { result } -} - -private fun CliktCommand.succeed(cmd: String) { - val result = test(cmd) - require(result.statusCode == 0) { result } -} - @OptIn(kotlin.io.path.ExperimentalPathApi::class) class EbicsTest { private val nexusCmd = LibeufinNexus()