From 9cf87dd318ce4e52ae072e3024209422afd46e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20F=C3=B6rster?= Date: Tue, 25 Jun 2024 01:41:24 +0200 Subject: [PATCH] [dev-libs/mongo-c-driver] add a test-full useflag to mask on non-mongodb arches --- dev-libs/mongo-c-driver/metadata.xml | 6 ++++ .../mongo-c-driver-1.27.2.ebuild | 31 ++++++++++++------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/dev-libs/mongo-c-driver/metadata.xml b/dev-libs/mongo-c-driver/metadata.xml index 6969885..ff90df0 100644 --- a/dev-libs/mongo-c-driver/metadata.xml +++ b/dev-libs/mongo-c-driver/metadata.xml @@ -5,6 +5,12 @@ ultrabug@gentoo.org Alexys Jacob + + + Run test suite in full, including tests that run a local + database instance. + + mongodb/mongo-c-driver diff --git a/dev-libs/mongo-c-driver/mongo-c-driver-1.27.2.ebuild b/dev-libs/mongo-c-driver/mongo-c-driver-1.27.2.ebuild index f79a39c..28e76c9 100644 --- a/dev-libs/mongo-c-driver/mongo-c-driver-1.27.2.ebuild +++ b/dev-libs/mongo-c-driver/mongo-c-driver-1.27.2.ebuild @@ -12,7 +12,7 @@ SRC_URI="https://github.com/mongodb/mongo-c-driver/archive/refs/tags/${PV}.tar.g LICENSE="Apache-2.0" SLOT="0" KEYWORDS="~amd64 ~arm64 ~hppa ~riscv ~x86" -IUSE="debug examples icu +s3 sasl +ssl static-libs test" +IUSE="debug examples icu +s3 sasl +ssl static-libs test +test-full" REQUIRED_USE=" s3? ( ssl ) test? ( static-libs )" @@ -36,10 +36,12 @@ RDEPEND=" DEPEND=" ${RDEPEND} test? ( - dev-db/mongodb dev-libs/libbson[static-libs] >=dev-libs/libmongocrypt-1.10.0[static-libs] >=dev-libs/libutf8proc-2.8.0:=[static-libs] + test-full? ( + dev-db/mongodb + ) ) " @@ -89,16 +91,21 @@ src_configure() { # FEATURES="test -network-sandbox" USE="static-libs" emerge dev-libs/mongo-c-driver src_test() { - local PORT=27099 - LC_ALL=C \ - mongod --setParameter enableTestCommands=1 \ - --enableMajorityReadConcern --port ${PORT} \ - --bind_ip 127.0.0.1 --nounixsocket --fork --dbpath="${T}" \ - --logpath="${T}/mongod.log" || die - MONGOC_TEST_URI="mongodb://[127.0.0.1]:${PORT}" \ - MONGOC_ENABLE_MAJORITY_READ_CONCERN=on \ - ../mongo-c-driver-${PV}_build/src/libmongoc/test-libmongoc \ - --skip-tests "${FILESDIR}/skip-tests.txt" || die + if ! use test-full; then + export MONGOC_TEST_SKIP_LIVE=on + else + local PORT=27099 + export MONGOC_TEST_URI="mongodb://[127.0.0.1]:${PORT}" + export MONGOC_ENABLE_MAJORITY_READ_CONCERN=on + LC_ALL=C \ + mongod --setParameter enableTestCommands=1 \ + --enableMajorityReadConcern --port ${PORT} \ + --bind_ip 127.0.0.1 --nounixsocket --fork \ + --dbpath="${T}" --logpath="${T}/mongod.log" || die + fi + + ../mongo-c-driver-${PV}_build/src/libmongoc/test-libmongoc \ + --skip-tests "${FILESDIR}/skip-tests.txt" || die kill $(<"${T}/mongod.lock") }