-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from MerginMaps/ci_tests
Ci tests + black style
- Loading branch information
Showing
12 changed files
with
593 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Code Layout | ||
|
||
on: push | ||
|
||
jobs: | ||
code_style_python: | ||
name: Python code convention check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: psf/black@stable | ||
with: | ||
options: "--check --verbose --diff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Tests for Mergin Maps Media Sync | ||
|
||
on: | ||
push: | ||
paths: | ||
- "test/**" | ||
- "**.py" | ||
- ".github/workflows/tests_mergin_media_sync.yaml" | ||
|
||
env: | ||
TEST_MERGIN_URL: https://test.dev.merginmaps.com | ||
TEST_API_USERNAME: test_media_sync | ||
TEST_API_PASSWORD: ${{ secrets.TEST_API_PASSWORD }} | ||
TEST_API_WORKSPACE: test-media-sync | ||
TEST_MINIO_URL: 127.0.0.1:9000 | ||
TEST_MINIO_ACCESS_KEY: minioaccesskey | ||
TEST_MINIO_SECRET_KEY: miniosecretkey | ||
|
||
jobs: | ||
|
||
Tests-for-Mergin-Maps-Media-Sync: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Install Spatialite | ||
run: sudo apt-get install -y libsqlite3-mod-spatialite | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install pipenv | ||
pipenv install | ||
pipenv install --dev | ||
- name: Run MinIO Docker | ||
run: | | ||
docker run -d \ | ||
-p 127.0.0.1:9000:9000 \ | ||
-p 127.0.0.1:9001:9001 \ | ||
-e MINIO_ROOT_USER=$TEST_MINIO_ACCESS_KEY \ | ||
-e MINIO_ROOT_PASSWORD=$TEST_MINIO_SECRET_KEY \ | ||
--entrypoint /bin/bash \ | ||
minio/minio:latest -c "minio server /data --console-address :9001 --address :9000" | ||
- name: Test MinIO and Mergin Client | ||
shell: pipenv run python {0} | ||
run: | | ||
import os | ||
from minio import Minio | ||
from mergin import MerginClient | ||
client = Minio( | ||
endpoint="127.0.0.1:9000", | ||
access_key=os.environ.get('TEST_MINIO_ACCESS_KEY'), | ||
secret_key=os.environ.get('TEST_MINIO_SECRET_KEY'), | ||
secure=False, | ||
) | ||
mc = MerginClient(os.environ.get('TEST_MERGIN_URL'), | ||
login=os.environ.get('TEST_API_USERNAME'), | ||
password=os.environ.get('TEST_API_PASSWORD')) | ||
- name: Run tests | ||
run: | | ||
pipenv run pytest test --cov=. --cov-report=term-missing:skip-covered -vv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.