Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 1f2a5dc

Browse files
committed
fix: e2e tests
1 parent ac8aeff commit 1f2a5dc

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

engine/controllers/engines.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ void Engines::InstallEngine(
174174
norm_version = version;
175175
}
176176

177-
if ((*(req->getJsonObject())).get("type", "").asString() == "remote") {
177+
if ((req->getJsonObject()) &&
178+
(*(req->getJsonObject())).get("type", "").asString() == "remote") {
178179
auto type = (*(req->getJsonObject())).get("type", "").asString();
179180
auto api_key = (*(req->getJsonObject())).get("api_key", "").asString();
180181
auto url = (*(req->getJsonObject())).get("url", "").asString();
@@ -260,12 +261,14 @@ void Engines::InstallEngine(
260261
res["message"] = result.error();
261262
auto resp = cortex_utils::CreateCortexHttpJsonResponse(res);
262263
resp->setStatusCode(k400BadRequest);
264+
CTL_INF("Error: " << result.error());
263265
callback(resp);
264266
} else {
265267
Json::Value res;
266268
res["message"] = "Engine starts installing!";
267269
auto resp = cortex_utils::CreateCortexHttpJsonResponse(res);
268270
resp->setStatusCode(k200OK);
271+
CTL_INF("Engine starts installing!");
269272
callback(resp);
270273
}
271274
}

engine/e2e-test/test_cli_model_pull_direct_url.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from test_runner import run
2+
from test_runner import start_server, stop_server
23
import os
34
from pathlib import Path
45

engine/services/model_service.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ void ParseGguf(const DownloadItem& ggufDownloadItem,
6464

6565
auto author_id = author.has_value() ? author.value() : "cortexso";
6666
cortex::db::Models modellist_utils_obj;
67-
cortex::db::ModelEntry model_entry{.model = ggufDownloadItem.id,
68-
.author_repo_id = author_id,
69-
.branch_name = branch,
70-
.path_to_model_yaml = rel.string(),
71-
.model_alias = ggufDownloadItem.id};
67+
cortex::db::ModelEntry model_entry{
68+
.model = ggufDownloadItem.id,
69+
.author_repo_id = author_id,
70+
.branch_name = branch,
71+
.path_to_model_yaml = rel.string(),
72+
.model_alias = ggufDownloadItem.id,
73+
.status = cortex::db::ModelStatus::Downloaded};
7274
auto result = modellist_utils_obj.AddModelEntry(model_entry, true);
7375
if (result.has_error()) {
7476
CTL_WRN("Error adding model to modellist: " + result.error());

0 commit comments

Comments
 (0)