commit:     ce3df200dcf0857155b695bc917825d4edea840c
Author:     Matt Whitlock <gentoo <AT> mattwhitlock <DOT> name>
AuthorDate: Tue Oct 24 16:00:31 2023 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Wed Oct 25 08:37:20 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce3df200

net-p2p/bitcoin-core: run functional tests if USE="daemon"

Add --without-seccomp since the sandbox is broken and has been dropped
upstream in 26.0 anyway.

Pass --timeout-factor (default: 15) to test/functional/test_runner.py
since our system may not be as quick as the machines upstream tests on,
especially if we happen to be building multiple packages in parallel.
Set TIMEOUT_FACTOR in package env to override.

Signed-off-by: Matt Whitlock <gentoo <AT> mattwhitlock.name>
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 net-p2p/bitcoin-core/bitcoin-core-25.1-r1.ebuild | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/net-p2p/bitcoin-core/bitcoin-core-25.1-r1.ebuild 
b/net-p2p/bitcoin-core/bitcoin-core-25.1-r1.ebuild
index 5eadbf6fddce..4d55cae08417 100644
--- a/net-p2p/bitcoin-core/bitcoin-core-25.1-r1.ebuild
+++ b/net-p2p/bitcoin-core/bitcoin-core-25.1-r1.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
 
-inherit autotools bash-completion-r1 db-use desktop python-any-r1 systemd 
xdg-utils
+inherit autotools bash-completion-r1 check-reqs db-use desktop edo 
multiprocessing python-any-r1 systemd xdg-utils
 
 DESCRIPTION="Reference implementation of the Bitcoin cryptocurrency"
 HOMEPAGE="https://bitcoincore.org/";
@@ -123,10 +123,17 @@ pkg_pretend() {
                        configuration, but your Bitcoin node will be unable to 
open any wallets.
                EOF
        fi
+
+       # test/functional/feature_pruning.py requires 4 GB disk space
+       # test/functional/wallet_pruning.py requires 1.3 GB disk space
+       use test && CHECKREQS_DISK_BUILD="6G" check-reqs_pkg_pretend
 }
 
 pkg_setup() {
-       use test && python-any-r1_pkg_setup
+       if use test ; then
+               CHECKREQS_DISK_BUILD="6G" check-reqs_pkg_setup
+               python-any-r1_pkg_setup
+       fi
 }
 
 src_prepare() {
@@ -174,6 +181,9 @@ src_configure() {
                --enable-util-tx
                --${wallet}-util-wallet
                --disable-util-util
+               # syscall sandbox is missing faccessat2 and pselect6, causing 
bitcoind to crash during tests;
+               # removed upstream for 26.0 in 
https://github.com/bitcoin/bitcoin/commit/32e2ffc39374f61bb2435da507f285459985df9e
+               --without-seccomp
                $(use_with libs)
                $(use_with daemon)
                $(use_with gui gui qt5)
@@ -184,6 +194,13 @@ src_configure() {
        econf "${myeconfargs[@]}"
 }
 
+src_test() {
+       emake check
+
+       use daemon && edo "${PYTHON}" test/functional/test_runner.py \
+                       --ansi --extended --jobs="$(get_makeopts_jobs)" 
--timeout-factor="${TIMEOUT_FACTOR:-15}"
+}
+
 src_install() {
        use external-signer && DOCS+=( doc/external-signer.md )
        use berkdb || use sqlite && DOCS+=( doc/managing-wallets.md )

Reply via email to