Skip to content

Commit

Permalink
Add docker-compose to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Mar 17, 2024
1 parent 10fbf92 commit 70d44b5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ Build args:

Tests are written using [pytest](https://pytest.org) in the `tests` directory.

You can run them using the `runtests.sh` script inside the container, like this:
You can run them using the `runtests.sh` script inside the container.

In the test directory, there is a `docker-compose.yml` to help run the tests.
Tune it to your liking, then run:

`docker compose run --build test ./runtests.sh -v`

```console
docker run -v $PWD/tests:/mnt/tests ghcr.io/oca/oca-ci/py3.8-odoo14.0:latest /mnt/tests/runtests.sh -v
```
19 changes: 19 additions & 0 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
test:
build:
context: ..
args:
codename: jammy
python_version: "3.10"
odoo_version: "16.0"
volumes:
- .:/mnt/tests
working_dir: /mnt/tests
depends_on:
- postgres
postgres:
image: postgres
environment:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
POSTGRES_DB: odoo

0 comments on commit 70d44b5

Please sign in to comment.