diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6d8ff33238c6b2d5e20bab97b463ad991db13894..3ed25c8b63e8c457bbdc4ae29a1b55c0c3e3416a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,9 +13,16 @@ run-tox-pipeline: - docker-executor image: python:3.10 + services: + - postgres:15.4 + # Change pip's cache directory to be inside the project directory since we can # only cache local items. variables: + POSTGRES_DB: gso-test-db + POSTGRES_USER: gso + POSTGRES_PASSWORD: gso + DATABASE_URI_TEST: 'postgresql://gso:gso@postgres:5432/gso-test-db' PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" # Pip's cache doesn't store the python packages diff --git a/test/conftest.py b/test/conftest.py index 138adc0bb496222e54b365d4c6426a257c5bd808..626ea3fe1f6805782c6aac55b7ee92a573c9450e 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -93,7 +93,7 @@ def data_config_filename(configuration_data) -> str: def db_uri(): """Provide the database uri configuration to run the migration on.""" - return os.environ.get("DATABASE_URI_TEST", "postgresql://nwa:nwa@localhost/nwa-workflows-test") + return os.environ.get("DATABASE_URI_TEST", "postgresql://gso:gos@localhost/gso-test-db") def run_migrations(db_uri: str) -> None: diff --git a/tox.ini b/tox.ini index ed2f8f9ad2007e11acacc02d1cc50541b0982838..5c95129343d80cf2b7cedb3124a585bdbfdc83ae 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,7 @@ max-line-length = 120 ban-relative-imports = true [testenv] +passenv = DATABASE_URI_TEST deps = coverage flake8