Merge bitcoin/bitcoin#34679: ci: Download script_assets_test.json for Windows CI

fa7612f253 ci: Download script_assets_test.json for Windows CI (MarcoFalke)
7777a13306 test: Move Fetching-print to download_from_url util (MarcoFalke)
faf96286ce test: move-only download_from_url to stand-alone util file (MarcoFalke)
fa0cc1c5a4 test: [doc] Remove outdated comment (MarcoFalke)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/34670 by adding a new `download_script_assets` Python helper and calling it.

ACKs for top commit:
  hebasto:
    re-ACK fa7612f253.
  janb84:
    re ACK fa7612f253
  hodlinator:
    utACK fa7612f253

Tree-SHA512: 73c2cb3a31f231174566fb880b82de92734b1679ef000f8d793d774b7e5f5a7b8c7994a3998ca78821115bdc80c16aada69cf596e92c083cf9b9a95c7cee16ea
This commit is contained in:
merge-script
2026-03-04 10:39:47 +00:00
5 changed files with 91 additions and 54 deletions

View File

@@ -10,6 +10,9 @@ import subprocess
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).resolve().parent.parent / "test"))
from download_utils import download_script_assets
def run(cmd, **kwargs):
print("+ " + shlex.join(cmd), flush=True)
@@ -81,6 +84,9 @@ def prepare_tests():
run(cmd_download_prev_rel)
run([sys.executable, "-m", "pip", "install", "pyzmq"])
dest = workspace / "unit_test_data"
download_script_assets(dest)
def run_functional_tests():
workspace = Path.cwd()
@@ -117,6 +123,8 @@ def run_functional_tests():
def run_unit_tests():
workspace = Path.cwd()
os.environ["DIR_UNIT_TEST_DATA"] = str(workspace / "unit_test_data")
# Can't use ctest here like other jobs as we don't have a CMake build tree.
commands = [
["./bin/test_bitcoin-qt.exe"],

16
.github/ci-windows.py vendored
View File

@@ -10,6 +10,9 @@ import subprocess
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).resolve().parent.parent / "test"))
from download_utils import download_script_assets
def run(cmd, **kwargs):
print("+ " + shlex.join(cmd), flush=True)
@@ -126,10 +129,13 @@ def check_manifests(ci_type):
def prepare_tests(ci_type):
workspace = Path.cwd()
if ci_type == "standard":
run([sys.executable, "-m", "pip", "install", "pyzmq"])
dest = workspace / "unit_test_data"
download_script_assets(dest)
elif ci_type == "fuzz":
repo_dir = str(Path.cwd() / "qa-assets")
repo_dir = str(workspace / "qa-assets")
clone_cmd = [
"git",
"clone",
@@ -143,11 +149,13 @@ def prepare_tests(ci_type):
def run_tests(ci_type):
build_dir = Path.cwd() / "build"
workspace = Path.cwd()
build_dir = workspace / "build"
num_procs = str(os.process_cpu_count())
release_bin = build_dir / "bin" / "Release"
if ci_type == "standard":
os.environ["DIR_UNIT_TEST_DATA"] = str(workspace / "unit_test_data")
test_envs = {
"BITCOIN_BIN": "bitcoin.exe",
"BITCOIND": "bitcoind.exe",
@@ -180,7 +188,7 @@ def run_tests(ci_type):
"--jobs",
num_procs,
"--quiet",
f"--tmpdirprefix={Path.cwd()}",
f"--tmpdirprefix={workspace}",
"--combinedlogslen=99999999",
*shlex.split(os.environ.get("TEST_RUNNER_EXTRA", "").strip()),
]
@@ -195,7 +203,7 @@ def run_tests(ci_type):
num_procs,
"--loglevel",
"DEBUG",
str(Path.cwd() / "qa-assets" / "fuzz_corpora"),
str(workspace / "qa-assets" / "fuzz_corpora"),
]
run(fuzz_cmd)

View File

@@ -428,13 +428,12 @@ jobs:
- name: Check executable manifests
run: py -3 .github/ci-windows-cross.py check_manifests
- name: Prepare Windows test environment
run: py -3 .github/ci-windows-cross.py prepare_tests
- name: Run unit tests
run: py -3 .github/ci-windows-cross.py run_unit_tests
- name: Prepare Windows test environment
run: |
py -3 .github/ci-windows-cross.py prepare_tests
- name: Run functional tests
env:
TEST_RUNNER_EXTRA: "--timeout-factor=${{ env.TEST_RUNNER_TIMEOUT_FACTOR }} ${{ case(github.event_name == 'pull_request', '', '--extended') }}"