Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Caha committed Nov 29, 2023
1 parent 4e4dbf1 commit adaef8a
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/tests_mergin_media_sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,43 @@ on:
- "**.py"
- ".github/workflows/tests_mergin_media_sync.yaml"

env:
TEST_MINIO_ACCESS_KEY: minioaccesskey
TEST_MINIO_SECRET_KEY: miniosecretkey

jobs:

Tests-for-Mergin-Maps-Media-Sync:

runs-on: ubuntu-latest

services:
minio:
image: minio/minio:latest
ports:
- 9000:9000
env:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
MINIO_CI_CD: on
MINIO_ACCESS_KEY: minioaccesskey
MINIO_SECRET_KEY: miniosecretkey
options: --name=minio --health-cmd "curl http://localhost:9000/minio/health/live"

steps:

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install mergin-client pytest pytest-cov dynaconf psycopg2 minio
- name: Run MinIO Docker
run: |
docker run \
-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
shell: python3
run: |
import os
from minio import Minio
client = Minio(
endpoint="127.0.0.1:9000",
access_key="minioaccesskey",
secret_key="miniosecretkey",
access_key=os.environ.get('TEST_MINIO_ACCESS_KEY'),
secret_key=os.environ.get('TEST_MINIO_SECRET_KEY'),
secure=False,
)
Expand Down

0 comments on commit adaef8a

Please sign in to comment.