Skip to content

Commit 694c3a2

Browse files
committed
pg
1 parent 7383098 commit 694c3a2

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

packages/pytest-simcore/src/pytest_simcore/environment_configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ def docker_compose_service_hostname(
144144
@pytest.fixture
145145
def docker_compose_service_environment_dict(
146146
docker_compose_services_dict: dict[str, Any],
147-
env_devel_dict: EnvVarsDict,
148147
service_name: str,
148+
env_devel_dict: EnvVarsDict,
149149
env_devel_file: Path,
150150
) -> EnvVarsDict:
151151
"""Returns env vars dict from the docker-compose `environment` section

services/web/server/tests/unit/with_dbs/03/test_login_auth_app.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
import sqlalchemy as sa
1313
from aiohttp import web
1414
from aiohttp.test_utils import TestClient, TestServer
15-
from faker import Faker
1615
from pytest_simcore.helpers.assert_checks import assert_status
1716
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
1817
from pytest_simcore.helpers.typing_env import EnvVarsDict
1918
from pytest_simcore.helpers.webserver_login import UserInfoDict
2019
from servicelib.aiohttp import status
2120
from simcore_service_webserver.application import create_application_auth
2221
from simcore_service_webserver.application_settings import ApplicationSettings
22+
from simcore_service_webserver.application_settings_utils import AppConfigDict
2323
from simcore_service_webserver.security import security_web
2424

2525

@@ -32,15 +32,26 @@ def service_name() -> str:
3232
def app_environment_for_wb_authz_service_dict(
3333
docker_compose_service_environment_dict: EnvVarsDict,
3434
docker_compose_service_hostname: str,
35+
default_app_cfg: AppConfigDict,
3536
) -> EnvVarsDict:
3637

38+
postgres_cfg = default_app_cfg["db"]["postgres"]
39+
3740
assert (
3841
docker_compose_service_environment_dict["WEBSERVER_APP_FACTORY_NAME"]
3942
== "WEBSERVER_AUTHZ_APP_FACTORY"
4043
)
4144

4245
return {
4346
**docker_compose_service_environment_dict,
47+
# NOTE: TEST-stack uses different env-vars
48+
# this is temporary here until we get rid of config files
49+
# SEE https://github.com/ITISFoundation/osparc-simcore/issues/8129
50+
"POSTGRES_DB": postgres_cfg["database"],
51+
"POSTGRES_HOST": postgres_cfg["host"],
52+
"POSTGRES_PORT": postgres_cfg["port"],
53+
"POSTGRES_USER": postgres_cfg["user"],
54+
"POSTGRES_PASSWORD": postgres_cfg["password"],
4455
"HOSTNAME": docker_compose_service_hostname,
4556
# TODO: add everything coming from Dockerfile?
4657
}
@@ -50,7 +61,6 @@ def app_environment_for_wb_authz_service_dict(
5061
def app_environment_for_wb_authz_service(
5162
monkeypatch: pytest.MonkeyPatch,
5263
app_environment_for_wb_authz_service_dict: EnvVarsDict,
53-
faker: Faker,
5464
service_name: str,
5565
) -> EnvVarsDict:
5666
"""Mocks the environment variables for the auth app service (considering docker-compose's environment)."""

0 commit comments

Comments
 (0)