From fa4a1cab6c179de4e48b574e0a325c74ab7a25f7 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 10 Feb 2026 12:24:29 +0100 Subject: [PATCH] ci: Move run_functional_tests into ci-windows-cross.py This is mostly a refactor, except for putting the temp dirs into Path.cwd(), which makes running this locally easier. Note, the use of process_cpu_count() is intentional. It was only added in Python 3.13, according to https://docs.python.org/3/library/os.html#os.process_cpu_count . However, Python 3.13 is also the minimum required version on Windows, according to https://github.com/bitcoin/bitcoin/issues/29897#issuecomment-2940318094 to avoid intermittent test failures. --- .github/ci-windows-cross.py | 37 +++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 12 ++---------- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/.github/ci-windows-cross.py b/.github/ci-windows-cross.py index 84be2ed1001..0085ede9138 100755 --- a/.github/ci-windows-cross.py +++ b/.github/ci-windows-cross.py @@ -82,12 +82,47 @@ def prepare_tests(): run([sys.executable, "-m", "pip", "install", "pyzmq"]) +def run_functional_tests(): + workspace = Path.cwd() + num_procs = str(os.process_cpu_count()) + test_runner_cmd = [ + sys.executable, + str(workspace / "test" / "functional" / "test_runner.py"), + "--jobs", + num_procs, + "--quiet", + f"--tmpdirprefix={workspace}", + "--combinedlogslen=99999999", + *shlex.split(os.environ.get("TEST_RUNNER_EXTRA", "").strip()), + # feature_unsupported_utxo_db.py fails on Windows because of emojis in the test data directory. + "--exclude", + "feature_unsupported_utxo_db.py", + # See https://github.com/bitcoin/bitcoin/issues/31409. + "--exclude", + "wallet_multiwallet.py", + ] + run(test_runner_cmd) + + # Run feature_unsupported_utxo_db sequentially in ASCII-only tmp dir, + # because it is excluded above due to lack of UTF-8 support in the + # ancient release. + cmd_feature_unsupported_db = [ + sys.executable, + str(workspace / "test" / "functional" / "feature_unsupported_utxo_db.py"), + "--previous-releases", + "--tmpdir", + str(Path(workspace) / "test_feature_unsupported_utxo_db"), + ] + run(cmd_feature_unsupported_db) + + def main(): parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.") steps = [ "print_version", "check_manifests", "prepare_tests", + "run_functional_tests", ] parser.add_argument("step", choices=steps, help="CI step to perform.") args = parser.parse_args() @@ -98,6 +133,8 @@ def main(): check_manifests() elif args.step == "prepare_tests": prepare_tests() + elif args.step == "run_functional_tests": + run_functional_tests() if __name__ == "__main__": diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 210bccc2c60..d310f3a5556 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -435,17 +435,9 @@ jobs: - name: Run functional tests env: - TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }} + TEST_RUNNER_EXTRA: "--timeout-factor=${{ env.TEST_RUNNER_TIMEOUT_FACTOR }} ${{ case(github.event_name == 'pull_request', '', '--extended') }}" run: | - py -3 test/functional/test_runner.py --jobs $NUMBER_OF_PROCESSORS --quiet --tmpdirprefix="$RUNNER_TEMP" --combinedlogslen=99999999 --timeout-factor=$TEST_RUNNER_TIMEOUT_FACTOR $TEST_RUNNER_EXTRA \ - `# feature_unsupported_utxo_db.py fails on Windows because of emojis in the test data directory.` \ - --exclude feature_unsupported_utxo_db.py \ - `# See https://github.com/bitcoin/bitcoin/issues/31409.` \ - --exclude wallet_multiwallet.py - # Run feature_unsupported_utxo_db sequentially in ASCII-only tmp dir, - # because it is excluded above due to lack of UTF-8 support in the - # ancient release. - py -3 test/functional/feature_unsupported_utxo_db.py --previous-releases --tmpdir="${RUNNER_TEMP}/test_feature_unsupported_utxo_db" + py -3 .github/ci-windows-cross.py run_functional_tests ci-matrix: name: ${{ matrix.name }}