diff --git a/.gitea/workflows/pull.yaml b/.gitea/workflows/pull.yaml index 0c4f15c..960a1e7 100644 --- a/.gitea/workflows/pull.yaml +++ b/.gitea/workflows/pull.yaml @@ -38,16 +38,7 @@ jobs: run: | /opt/poetry/bin/poetry run mypy . - name: Pytest & Calculate Coverage - env: - MINIO_ENDPOINT: ${{ vars.MINIO_ENDPOINT }} - MINIO_ACCESS_KEY: ${{ secrets.MINIO_ACCESS_KEY }} - MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY }} - MONGO_ENDPOINT: ${{ vars.MONGO_ENDPOINT }} run: | - echo "MINIO_ENDPOINT=${MINIO_ENDPOINT}" >> .env - echo "MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}" >> .env - echo "MINIO_SECRET_KEY=${MINIO_SECRET_KEY}" >> .env - echo "MONGO_ENDPOINT=${MONGO_ENDPOINT}" >> .env /opt/poetry/bin/poetry run coverage run -m pytest . - name: Coverage Report run: | diff --git a/shared/repositories/tests/integration/conftest.py b/shared/repositories/tests/integration/conftest.py index c759876..adba948 100644 --- a/shared/repositories/tests/integration/conftest.py +++ b/shared/repositories/tests/integration/conftest.py @@ -33,15 +33,18 @@ random.seed(13) # define test environment variables necessary_env_vars = { - 'MINIO_ENDPOINT', 'MINIO_ACCESS_KEY', 'MINIO_SECRET_KEY', 'MONGO_ENDPOINT', } env_var_map = { + 'MINIO_ENDPOINT': '192.168.1.2:9000', + 'MINIO_ACCESS_KEY': '1rMQTezbALeJyOgAbYYE', + 'MINIO_SECRET_KEY': 'O76GM756ybKYLFokZFJneaCoYwpaIbAlOdB7mcc0', 'MINIO_BUCKET_NAME': 'test-bucket', 'MINIO_OBJECT_NAME': 'test-object', 'MINIO_IMAGE_NAME': 'test-image', + 'MONGO_ENDPOINT': 'mongodb://192.168.1.2:27017/', 'MONGO_DB': 'test-db', 'MONGO_COLLECTION': 'test-collection', } @@ -55,11 +58,6 @@ def setup_env( # load in optional local test environment variables test_env_path = Path(__file__).parent.parent.parent.parent.parent / 'test.env' load_dotenv(test_env_path) - # load in optional CI environment variables - load_dotenv(os.getenv('GITHUB_ENV')) - # check if necessary env vars are set - for key in necessary_env_vars: - assert key in os.environ, f'{key} not set' # set testing env vars for key, val in env_var_map.items(): # set env var