* fix: enforce minimum version of docker/podman This allows to always pass `--platform` to the OCI engine thus fixing issues with multiarch images. * Allow older versions with warnings * Upgrade docker on Travis CI * fix: use `docker cp` instead of `tar` * Enforce docker>=24.0 * move log to include container.copy_into * fix: travis-ci, only update docker on aarch64 * skip test_multiarch_image on s390x / ppc64le * skip flaky test * chore: only install test deps on Travis CI * fix: do not try to pull images tagged `cibw_local` * use "--pull=never" for local images * Use docker image inspect to check if an image needs to be pulled
57 lines
1.5 KiB
Python
Executable File
57 lines
1.5 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
if __name__ == "__main__":
|
|
default_cpu_count = os.cpu_count() or 2
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument(
|
|
"--run-podman", action="store_true", default=False, help="run podman tests (linux only)"
|
|
)
|
|
parser.add_argument(
|
|
"--num-processes",
|
|
action="store",
|
|
default=default_cpu_count,
|
|
help="number of processes to use for testing",
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
# move cwd to the project root
|
|
os.chdir(Path(__file__).resolve().parents[1])
|
|
|
|
# unit tests
|
|
unit_test_args = [sys.executable, "-m", "pytest", "unit_test"]
|
|
|
|
if sys.platform.startswith("linux") and os.environ.get("CIBW_PLATFORM", "linux") == "linux":
|
|
# run the docker unit tests only on Linux
|
|
unit_test_args += ["--run-docker"]
|
|
|
|
if args.run_podman:
|
|
unit_test_args += ["--run-podman"]
|
|
|
|
subprocess.run(unit_test_args, check=True)
|
|
|
|
# integration tests
|
|
integration_test_args = [
|
|
sys.executable,
|
|
"-m",
|
|
"pytest",
|
|
f"--numprocesses={args.num_processes}",
|
|
"-x",
|
|
"--durations",
|
|
"0",
|
|
"--timeout=2400",
|
|
"test",
|
|
]
|
|
|
|
if sys.platform.startswith("linux") and args.run_podman:
|
|
integration_test_args += ["--run-podman"]
|
|
|
|
subprocess.run(integration_test_args, check=True)
|