1212import sqlalchemy as sa
1313from aiohttp import web
1414from aiohttp .test_utils import TestClient , TestServer
15- from faker import Faker
1615from pytest_simcore .helpers .assert_checks import assert_status
1716from pytest_simcore .helpers .monkeypatch_envs import setenvs_from_dict
1817from pytest_simcore .helpers .typing_env import EnvVarsDict
1918from pytest_simcore .helpers .webserver_login import UserInfoDict
2019from servicelib .aiohttp import status
2120from simcore_service_webserver .application import create_application_auth
2221from simcore_service_webserver .application_settings import ApplicationSettings
22+ from simcore_service_webserver .application_settings_utils import AppConfigDict
2323from simcore_service_webserver .security import security_web
2424
2525
@@ -32,15 +32,26 @@ def service_name() -> str:
3232def 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(
5061def 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