From e914c2bfdd469c30d378781906e3e408cab3b94e Mon Sep 17 00:00:00 2001 From: Carter Mak Date: Thu, 19 Oct 2023 14:47:34 -0700 Subject: [PATCH] Update integration tests to centralize mission model path --- tests/integration_tests/conftest.py | 5 +++++ tests/integration_tests/test_constraints.py | 6 +----- tests/integration_tests/test_expansion.py | 6 +----- tests/integration_tests/test_models.py | 7 +------ tests/integration_tests/test_plans.py | 6 +----- tests/integration_tests/test_scheduling.py | 6 +----- 6 files changed, 10 insertions(+), 26 deletions(-) diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py index 77660114..35a45def 100644 --- a/tests/integration_tests/conftest.py +++ b/tests/integration_tests/conftest.py @@ -40,6 +40,11 @@ FILES_PATH = os.path.join(TEST_DIR, "files") CONFIGURATIONS_PATH = os.path.join(FILES_PATH, "configuration") CONFIGURATION_PATH = os.path.join(CONFIGURATIONS_PATH, "localhost_config.json") +MODELS_PATH = os.path.join(FILES_PATH, "models") +MODEL_VERSION = os.environ.get("AERIE_VERSION", "1.13.0") +MODEL_JAR = os.path.join(MODELS_PATH, f"banananation-{MODEL_VERSION}.jar") +MODEL_NAME = "banananation" +MODEL_VERSION = "0.0.1" # Login to add additional users to the `users` table for username in ADDITIONAL_USERS: diff --git a/tests/integration_tests/test_constraints.py b/tests/integration_tests/test_constraints.py index f5fdbe13..1b04ce1d 100644 --- a/tests/integration_tests/test_constraints.py +++ b/tests/integration_tests/test_constraints.py @@ -1,6 +1,6 @@ from typer.testing import CliRunner -from .conftest import client +from .conftest import client, MODEL_JAR, MODEL_NAME, MODEL_VERSION from aerie_cli.__main__ import app from aerie_cli.schemas.client import ActivityPlanCreate @@ -16,10 +16,6 @@ FILES_PATH = os.path.join(TEST_DIR, "files") # Model Variables -MODELS_PATH = os.path.join(FILES_PATH, "models") -MODEL_JAR = os.path.join(MODELS_PATH, "banananation-1.12.0.jar") -MODEL_NAME = "banananation" -MODEL_VERSION = "0.0.1" model_id = -1 # Plan Variables diff --git a/tests/integration_tests/test_expansion.py b/tests/integration_tests/test_expansion.py index e96c79ff..c8d68b27 100644 --- a/tests/integration_tests/test_expansion.py +++ b/tests/integration_tests/test_expansion.py @@ -8,7 +8,7 @@ from aerie_cli.__main__ import app from aerie_cli.schemas.client import ActivityPlanCreate -from .conftest import client +from .conftest import client, MODEL_JAR, MODEL_NAME, MODEL_VERSION runner = CliRunner(mix_stderr = False) @@ -19,10 +19,6 @@ DOWNLOADED_FILE_NAME = "downloaded_file.test" # Model Variables -MODELS_PATH = os.path.join(FILES_PATH, "models") -MODEL_JAR = os.path.join(MODELS_PATH, "banananation-1.12.0.jar") -MODEL_NAME = "banananation" -MODEL_VERSION = "0.0.1" model_id = -1 # Plan Variables diff --git a/tests/integration_tests/test_models.py b/tests/integration_tests/test_models.py index aab56af3..36171ace 100644 --- a/tests/integration_tests/test_models.py +++ b/tests/integration_tests/test_models.py @@ -4,7 +4,7 @@ from aerie_cli.__main__ import app -from .conftest import client +from .conftest import client, MODEL_JAR, MODEL_NAME, MODEL_VERSION runner = CliRunner(mix_stderr = False) @@ -13,11 +13,6 @@ FILES_PATH = os.path.join(TEST_DIR, "files") # Model Variables -MODELS_PATH = os.path.join(FILES_PATH, "models") -MODEL_VERSION = os.environ.get("AERIE_VERSION", "1.13.0") -MODEL_JAR = os.path.join(MODELS_PATH, f"banananation-{MODEL_VERSION}.jar") -MODEL_NAME = "banananation" -MODEL_VERSION = "0.0.1" model_id = -1 def test_model_clean(): diff --git a/tests/integration_tests/test_plans.py b/tests/integration_tests/test_plans.py index 5d14fca4..16585426 100644 --- a/tests/integration_tests/test_plans.py +++ b/tests/integration_tests/test_plans.py @@ -7,7 +7,7 @@ from aerie_cli.__main__ import app from aerie_cli.commands import plans -from .conftest import client, DOWNLOADED_FILE_NAME, ADDITIONAL_USERS +from .conftest import client, DOWNLOADED_FILE_NAME, ADDITIONAL_USERS, MODEL_JAR, MODEL_NAME, MODEL_VERSION runner = CliRunner(mix_stderr = False) @@ -18,10 +18,6 @@ DOWNLOADED_FILE_NAME = "downloaded_file.test" # Model Variables -MODELS_PATH = os.path.join(FILES_PATH, "models") -MODEL_JAR = os.path.join(MODELS_PATH, "banananation-1.12.0.jar") -MODEL_NAME = "banananation" -MODEL_VERSION = "0.0.1" model_id = -1 # Plan Variables diff --git a/tests/integration_tests/test_scheduling.py b/tests/integration_tests/test_scheduling.py index 261e3a58..bd237ee0 100644 --- a/tests/integration_tests/test_scheduling.py +++ b/tests/integration_tests/test_scheduling.py @@ -8,7 +8,7 @@ from aerie_cli.__main__ import app from aerie_cli.schemas.client import ActivityPlanCreate -from .conftest import client +from .conftest import client, MODEL_JAR, MODEL_NAME, MODEL_VERSION runner = CliRunner(mix_stderr = False) @@ -19,10 +19,6 @@ DOWNLOADED_FILE_NAME = "downloaded_file.test" # Model Variables -MODELS_PATH = os.path.join(FILES_PATH, "models") -MODEL_JAR = os.path.join(MODELS_PATH, "banananation-1.12.0.jar") -MODEL_NAME = "banananation" -MODEL_VERSION = "0.0.1" model_id = 0 # Plan Variables