diff --git a/tests/README.md b/tests/README.md index 2026832..bf9426f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -3,9 +3,9 @@ This test suite relies on a test harness composed of a [Dockerfile](./Dockerfile) based on the `odoo-bedrock` images, as well as a [docker-compose.yml](./docker-compose.yml). -Prerequisites to run the test suite are `python3`, `docker-compose` and `pytest` +Prerequisites to run the test suite are `python3`, `docker compose` and `pytest` installed in the python environment. -Tests are launched with `pytest -v ./tests`. They start with a `docker-compose build` +Tests are launched with `pytest -v ./tests`. They start with a `docker compose build` using the `PYTHONTAG`, `DISTRO` and `ODOOVERSION` environment variables to determine the base `odoo-bedrock` image. diff --git a/tests/conftest.py b/tests/conftest.py index a17563a..fdf758d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -12,7 +12,7 @@ @pytest.fixture(scope="session", autouse=True) def compose_build(): - cmd = ["docker-compose", "build"] + cmd = ["docker", "compose", "build"] if "ODOOVERSION" in os.environ: cmd.extend(["--build-arg", f"ODOOVERSION={os.environ['ODOOVERSION']}"]) if "PYTHONTAG" in os.environ: @@ -35,13 +35,13 @@ def parsed_odoo_version(odoo_version): @pytest.fixture(scope="session") def compose_up(compose_build): - subprocess.run(["docker-compose", "up", "-d"], check=True, cwd=HERE) + subprocess.run(["docker", "compose", "up", "-d"], check=True, cwd=HERE) try: while compose_run(["pg_isready"], check=False).returncode != 0: time.sleep(2) yield finally: - subprocess.run(["docker-compose", "down"], check=True, cwd=HERE) + subprocess.run(["docker", "compose", "down"], check=True, cwd=HERE) @pytest.fixture diff --git a/tests/testlib.py b/tests/testlib.py index 4b4fcfa..0e756a2 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -15,7 +15,7 @@ def parsed_odoo_version(): def compose_run(command, env=None, check=True, volumes=None): - cmd = ["docker-compose", "run", "--rm"] + cmd = ["docker", "compose", "run", "--rm"] if env: for key, value in env.items(): cmd.extend(["-e", f"{key}={value}"])