diff --git a/mslib/mscolab/conf.py b/mslib/mscolab/conf.py index 998afa4d8..9adf5cfff 100644 --- a/mslib/mscolab/conf.py +++ b/mslib/mscolab/conf.py @@ -156,6 +156,10 @@ class setup_saml2_backend: # } # }, ] + # Setting up the path from environment variables to settings is only for testing purposes + mscolab_settings.MSCOLAB_SSO_DIR = os.getenv("TESTING_MSCOLAB_SSO_DIR", mscolab_settings.MSCOLAB_SSO_DIR) + mscolab_settings.USE_SAML2 = bool(os.getenv("TESTING_USE_SAML2", mscolab_settings.USE_SAML2)) + if os.path.exists(f"{mscolab_settings.MSCOLAB_SSO_DIR}/mss_saml2_backend.yaml"): with open(f"{mscolab_settings.MSCOLAB_SSO_DIR}/mss_saml2_backend.yaml", encoding="utf-8") as fobj: yaml_data = yaml.safe_load(fobj) diff --git a/tests/constants.py b/tests/constants.py index 8e782de48..fbdc1b0de 100644 --- a/tests/constants.py +++ b/tests/constants.py @@ -63,7 +63,12 @@ # we keep DATA_DIR until we move netCDF4 files to pyfilesystem2 DATA_DIR = DATA_FS.getsyspath("") +# set MSCOLAB_SSO_DIR through envs MSCOLAB_SSO_DIR = os.path.join(os.path.expanduser("~"), 'testingdatasso') +os.environ['TESTING_MSCOLAB_SSO_DIR'] = MSCOLAB_SSO_DIR + +# set TESTING_USE_SAML2 through envs +os.environ['TESTING_USE_SAML2'] = "True" # deployed mscolab url MSCOLAB_URL = "http://localhost:8083"