Skip to content

Commit bd48b1e

Browse files
author
Pedro Crespo
committed
Fixes login tests. Added new variable in config
1 parent f85a452 commit bd48b1e

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

services/web/server/tests/login/config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ smtp:
4242
password: None
4343
rest:
4444
version: v0
45-
location: ../../../../api/specs/webserver/v0/openapi.yaml
45+
location: ${OSPARC_SIMCORE_REPO_ROOTDIR}/api/specs/webserver/v0/openapi.yaml

services/web/server/tests/login/conftest.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,26 @@
2525
def here():
2626
return Path(sys.argv[0] if __name__ == "__main__" else __file__).resolve().parent
2727

28+
29+
@pytest.fixture(scope='session')
30+
def osparc_simcore_root_dir(here):
31+
root_dir = here.parent.parent.parent.parent.parent.resolve()
32+
assert root_dir.exists(), "Is this service within osparc-simcore repo?"
33+
assert any(root_dir.glob("services/web/server")), "%s not look like rootdir" % root_dir
34+
return root_dir
35+
2836
@pytest.fixture(scope="session")
29-
def app_cfg(here):
37+
def app_cfg(here, osparc_simcore_root_dir):
3038
cfg_path = here / "config.yaml"
3139
assert cfg_path.exists()
3240

41+
variables = dict(os.environ)
42+
variables.update({
43+
'OSPARC_SIMCORE_REPO_ROOTDIR': str(osparc_simcore_root_dir),
44+
})
45+
3346
# validates and fills all defaults/optional entries that normal load would not do
34-
cfg_dict = trafaret_config.read_and_validate(cfg_path, CONFIG_SCHEMA)
47+
cfg_dict = trafaret_config.read_and_validate(cfg_path, CONFIG_SCHEMA, vars=variables)
3548
return cfg_dict
3649

3750
@pytest.fixture(scope='session')

0 commit comments

Comments
 (0)