Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The ubuntu-latest gitlab runner does not have docker-compose anymore #37

Merged
merged 1 commit into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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