Skip to content

Commit f280264

Browse files
authored
Merge pull request #70 from sbidoul/test-compose
Add docker-compose to facilitate running tests
2 parents 10fbf92 + 70d44b5 commit f280264

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ Build args:
6868

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

71-
You can run them using the `runtests.sh` script inside the container, like this:
71+
You can run them using the `runtests.sh` script inside the container.
72+
73+
In the test directory, there is a `docker-compose.yml` to help run the tests.
74+
Tune it to your liking, then run:
75+
76+
`docker compose run --build test ./runtests.sh -v`
7277

73-
```console
74-
docker run -v $PWD/tests:/mnt/tests ghcr.io/oca/oca-ci/py3.8-odoo14.0:latest /mnt/tests/runtests.sh -v
75-
```

tests/docker-compose.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
test:
3+
build:
4+
context: ..
5+
args:
6+
codename: jammy
7+
python_version: "3.10"
8+
odoo_version: "16.0"
9+
volumes:
10+
- .:/mnt/tests
11+
working_dir: /mnt/tests
12+
depends_on:
13+
- postgres
14+
postgres:
15+
image: postgres
16+
environment:
17+
POSTGRES_USER: odoo
18+
POSTGRES_PASSWORD: odoo
19+
POSTGRES_DB: odoo

0 commit comments

Comments
 (0)