From 5f3fcb392a69511f4d3cbf5ead9948188fc0ef1d Mon Sep 17 00:00:00 2001 From: Samsul Hadi Date: Mon, 8 Apr 2024 12:21:31 +0700 Subject: [PATCH] fix: failing test --- .github/workflows/actions.yaml | 5 +++++ uselevers/tests/conftest.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 8407970..da254aa 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -2,6 +2,11 @@ name: Uselevers Backend on: [push] +env: + USELEVERS_DB_USER: ${{ secrets.USELEVERS_DB_USER }} + USELEVERS_DB_NAME: ${{ secrets.USELEVERS_DB_NAME }} + USELEVERS_DB_PASSWORD: ${{ secrets.USELEVERS_DB_PASSWORD }} + jobs: tests: runs-on: ubuntu-latest diff --git a/uselevers/tests/conftest.py b/uselevers/tests/conftest.py index 5733e53..84be10f 100644 --- a/uselevers/tests/conftest.py +++ b/uselevers/tests/conftest.py @@ -1,4 +1,4 @@ -# import os +import os from collections.abc import Generator from urllib.parse import ParseResult, urlparse @@ -26,8 +26,8 @@ def random_database_uri(original: str) -> ParseResult: def alembic_engine() -> Generator[Engine, None, None]: # Configure a random database URI sqlalchemy_new_uri = urlparse(str(settings.SQLALCHEMY_DATABASE_URI)) - # if os.getenv("GITHUB_ACTIONS") != "true": - # sqlalchemy_new_uri = random_database_uri(str(settings.SQLALCHEMY_DATABASE_URI)) + if os.getenv("GITHUB_ACTIONS") != "true": + sqlalchemy_new_uri = random_database_uri(str(settings.SQLALCHEMY_DATABASE_URI)) sqlalchemy_database = sqlalchemy_new_uri.path.replace("/", "") # Create an engine to connect to the default URL