ci: Move run_functional_tests into ci-windows-cross.py
What changed, and why it matters
This commit is a straightforward internal cleanup of Bitcoin Core's Windows CI (continuous integration) script. It moves the existing functional-test command from the GitHub Actions YAML file into a Python helper script, with no changes to the actual Bitcoin node code that users run. There is no security-relevant change visible in the diff.
No security action required. Treat as normal CI maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change refactors how Windows cross-compilation CI runs functional tests. The shell command previously embedded in .github/workflows/ci.yml is relocated into .github/ci-windows-cross.py as a new run_functional_tests() step invoked via argparse. The command arguments are preserved: same test_runner.py path, same –quiet, –combinedlogslen=99999999, same exclusions (feature_unsupported_utxo_db.py, wallet_multiwallet.py), and the same sequential fallback for feature_unsupported_utxo_db.py. Notable minor adjustments: tmpdirprefix now uses Path.cwd() instead of $RUNNER_TEMP; CPU parallelism uses os.process_cpu_count() (Python 3.13+) instead of $NUMBER_OF_PROCESSORS; TEST_RUNNER_EXTRA now also carries –timeout-factor via the environment. None of these alter consensus, networking, wallet, or RPC behavior of the shipped software.
Changed components
.github/ci-windows-cross.py.github/workflows/ci.ymlInspect captured patch +39 / −10
diff --git a/.github/ci-windows-cross.py b/.github/ci-windows-cross.py
index 84be2ed1..0085ede9 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 210bccc2..d310f3a5 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 }}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.