added more explicit env var loading
Code Quality Pipeline / Check Code (pull_request) Failing after 3m45s

This commit is contained in:
brian
2025-03-17 22:46:52 +00:00
parent ab7e346939
commit 280dbb579e
@@ -31,11 +31,6 @@ from shared.repositories.src.implementations import (
# set random seed for reproducibility # set random seed for reproducibility
random.seed(13) random.seed(13)
# load local test environment variables
test_env_path = Path(__file__).parent.parent.parent.parent.parent / 'test.env'
load_dotenv(test_env_path.as_posix())
load_dotenv(os.getenv('GITHUB_ENV', default='.'))
# define test environment variables # define test environment variables
necessary_env_vars = { necessary_env_vars = {
'MINIO_ENDPOINT', 'MINIO_ENDPOINT',
@@ -57,6 +52,11 @@ def setup_env(
request: pytest.FixtureRequest, request: pytest.FixtureRequest,
) -> None: ) -> None:
"""Populate environment with variables used for testing.""" """Populate environment with variables used for testing."""
# 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 # check if necessary env vars are set
for key in necessary_env_vars: for key in necessary_env_vars:
assert key in os.environ, f'{key} not set' assert key in os.environ, f'{key} not set'