Skip to content

Commit

Permalink
test: local dev container uses local mount for faster testing (#391)
Browse files Browse the repository at this point in the history
* test: local dev container uses local mount for faster testing

* doc: update contributing.md for this new feature

* test: have CI still build pgbelt dependencies as part of image to not slow it down
  • Loading branch information
vjeeva authored Feb 21, 2024
1 parent b4f31b0 commit 42318ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ venv
build/*
dist/*
logs/*
configs/integrationtest-datacenter/*
.python-version
.mypy_cache
__pycache__/
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Simply run the following to spin the above up and drop yourself into your contai

_Note_: the DC and DB for the above environment are [here](https://github.com/Autodesk/pgbelt/blob/main/tests/integration/conftest.py#L20-L21).

Note: your local code will be _mounted_ to your container instead of copied. This allows you to edit your code on your laptop, then go into the container and run `pip3 install -e .` to update your container's `belt` binary for quick testing iterations.

Once you are done, you can exit out of the above container. Then, for cleanliness, please run the following to clean up `docker` and `docker-compose`:

make clean-docker
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,16 @@ services:
TEST_PG_DST_PORT: 5432
TEST_PG_DST_ROOT_USERNAME: postgres
TEST_PG_DST_ROOT_PASSWORD: postgres
command: bash -c "poetry run python3 tests/integration/conftest.py && pip3 install -e . && bash"
command: bash -c "cd /pgbelt-volume/ && poetry run python3 tests/integration/conftest.py && pip3 install -e . && bash"
depends_on:
db-src:
condition: service_healthy
db-dst:
condition: service_healthy
networks:
- datacenter
volumes:
- ./:/pgbelt-volume/:rw

networks:
datacenter:
Expand Down

0 comments on commit 42318ef

Please sign in to comment.