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

Extend integration tests #270

Closed
wants to merge 7 commits into from
Closed
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
13 changes: 13 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Integration tests

on: [ workflow_dispatch ]

jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Build and run integration tests
run: docker compose run --entrypoint poetry flask run pytest tests/integration/
- name: clean-up
run: docker compose down -v
9 changes: 9 additions & 0 deletions docs/development-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ To run all unit tests, run this command in the project path:
pytest tests/unit
```

To run all integration tests in Docker containers, run the following command in the project path.
Make sure that you do not have an old volume in use from previous tests, which could lead to conflicts.

```bash
docker compose run --entrypoint poetry flask run pytest tests/integration/
# Clean up afterwards:
docker compose down -v
```

## JS and CSS

For the individual html pages the js and css code should be developed in `client-src/**` as
Expand Down
4 changes: 4 additions & 0 deletions sketch_map_tool/database/client_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def open_connection():
db_conn.autocommit = True


if db_conn is None:
open_connection()


def close_connection():
global db_conn
if isinstance(db_conn, connection) and db_conn.closed == 0: # 0 if the conn is open
Expand Down
Loading