Skip to content

Commit

Permalink
Merge pull request #37 from acsone/docker-compose-sbi
Browse files Browse the repository at this point in the history
The ubuntu-latest gitlab runner does not have docker-compose anymore
  • Loading branch information
sbidoul authored Aug 4, 2024
2 parents 4fe0cd3 + 6bc8700 commit fa74fe4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"])
Expand Down

0 comments on commit fa74fe4

Please sign in to comment.