Skip to content

Commit

Permalink
Set up configuration in conftest
Browse files Browse the repository at this point in the history
  • Loading branch information
Navarro-Jonathan committed Aug 8, 2023
1 parent 856b39e commit 87886e6
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions tests/integration_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from aerie_cli.commands.configurations import delete_all_persistent_files, upload_configurations, deactivate_session, activate_session
from aerie_cli.utils.sessions import get_active_session_client


# in case src_path is not from aeri-cli src and from site-packages
src_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + "/../src")
sys.path.insert(0, src_path)
Expand Down Expand Up @@ -45,17 +44,15 @@
CONFIGURATIONS_PATH = os.path.join(FILES_PATH, "configuration")
CONFIGURATION_PATH = os.path.join(CONFIGURATIONS_PATH, "localhost_config.json")

@pytest.fixture(scope="session", autouse=True)
def set_up_environment(request):
# Resets the configurations and adds localhost
deactivate_session()
delete_all_persistent_files()
upload_configurations(CONFIGURATION_PATH)
activate_session("localhost")
persisent_client = None
try:
persisent_client = get_active_session_client()
except:
raise RuntimeError("Configuration is not active!")
assert persisent_client.host_session.gateway_url == GATEWAY_URL,\
"Aerie instances are mismatched. Ensure test URLs are the same."
# Resets the configurations and adds localhost
deactivate_session()
delete_all_persistent_files()
upload_configurations(CONFIGURATION_PATH)
activate_session("localhost")
persisent_client = None
try:
persisent_client = get_active_session_client()
except:
raise RuntimeError("Configuration is not active!")
assert persisent_client.host_session.gateway_url == GATEWAY_URL,\
"Aerie instances are mismatched. Ensure test URLs are the same."

0 comments on commit 87886e6

Please sign in to comment.