Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "Pointing to the legacy endpoint for model configs for now."" #91

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion service/utils/tds.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
TDS_PASSWORD = settings.TDS_PASSWORD
TDS_SIMULATIONS = "/simulations"
TDS_DATASETS = "/datasets"
TDS_CONFIGURATIONS = "/model-configurations"
TDS_CONFIGURATIONS = "/model-configurations-legacy"


def tds_session():
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_calibrate_example(
requests_mock.put(
f"{TDS_URL}/simulations/{simulation_id}", json={"status": "success"}
)
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model)

worker.work(burst=True)

Expand Down
4 changes: 3 additions & 1 deletion tests/integration/test_ensemble_calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def test_ensemble_calibrate_example(
]
for config_id in config_ids:
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

dataset_id = example_context["request"]["dataset"]["id"]
filename = example_context["request"]["dataset"]["filename"]
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/test_ensemble_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def test_ensemble_simulate_example(
]
for config_id in config_ids:
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

requests_mock.post(f"{TDS_URL}/simulations", json={"id": str(job_id)})

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_optimize_example(
requests_mock.put(
f"{TDS_URL}/simulations/{simulation_id}", json={"status": "success"}
)
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model)

worker.work(burst=True)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_simulate_example(
requests_mock.put(
f"{TDS_URL}/simulations/{simulation_id}", json={"status": "success"}
)
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model)

worker.work(burst=True)

Expand Down
20 changes: 15 additions & 5 deletions tests/test_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def test_example_conversion(self, example_context, requests_mock):

config_id = example_context["request"]["model_config_id"]
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

### Act and Assert

Expand All @@ -60,7 +62,9 @@ def test_example_conversion(self, example_context, requests_mock):

config_id = example_context["request"]["model_config_id"]
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

dataset_id = example_context["request"]["dataset"]["id"]
filename = example_context["request"]["dataset"]["filename"]
Expand Down Expand Up @@ -89,7 +93,9 @@ def test_example_conversion(self, example_context, requests_mock):
]
for config_id in config_ids:
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

### Act and Assert

Expand All @@ -110,7 +116,9 @@ def test_example_conversion(self, example_context, requests_mock):
]
for config_id in config_ids:
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

dataset_id = example_context["request"]["dataset"]["id"]
filename = example_context["request"]["dataset"]["filename"]
Expand All @@ -137,7 +145,9 @@ def test_example_conversion(self, example_context, requests_mock):

config_id = example_context["request"]["model_config_id"]
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

### Act and Assert

Expand Down
Loading