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.
This commit is contained in:
2 files changed
+39
-10
No files matched your search
@@ -82,12 +82,47 @@ def prepare_tests():
|
|||||||
run([sys.executable, "-m", "pip", "install", "pyzmq"])
|
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():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.")
|
parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.")
|
||||||
steps = [
|
steps = [
|
||||||
"print_version",
|
"print_version",
|
||||||
"check_manifests",
|
"check_manifests",
|
||||||
"prepare_tests",
|
"prepare_tests",
|
||||||
|
"run_functional_tests",
|
||||||
]
|
]
|
||||||
parser.add_argument("step", choices=steps, help="CI step to perform.")
|
parser.add_argument("step", choices=steps, help="CI step to perform.")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@@ -98,6 +133,8 @@ def main():
|
|||||||
check_manifests()
|
check_manifests()
|
||||||
elif args.step == "prepare_tests":
|
elif args.step == "prepare_tests":
|
||||||
prepare_tests()
|
prepare_tests()
|
||||||
|
elif args.step == "run_functional_tests":
|
||||||
|
run_functional_tests()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -435,17 +435,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Run functional tests
|
- name: Run functional tests
|
||||||
env:
|
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: |
|
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 \
|
py -3 .github/ci-windows-cross.py run_functional_tests
|
||||||
`# 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"
|
|
||||||
|
|
||||||
ci-matrix:
|
ci-matrix:
|
||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
|
|||||||
Reference in new issue
Block a user