Skip to content

Commit

Permalink
fix config test (#1122)
Browse files Browse the repository at this point in the history
* ET-XXXX-fix-config-test

* fixed config tests

* moved cmd test back to web-api

* renamed WebApiConfig => Config to follow naming conventions

* removed some now uneccessary generics and updated the --print-config setup

* fix doc
  • Loading branch information
rustonaut authored Dec 13, 2023
1 parent 4499fca commit 9061557
Show file tree
Hide file tree
Showing 19 changed files with 435 additions and 259 deletions.
88 changes: 77 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ xayn-web-api-shared = { path = "../web-api-shared" }
[dev-dependencies]
base64 = { workspace = true }
itertools = { workspace = true }
trycmd = "0.14.16"
url = { workspace = true }

[dev-dependencies.old-xayn-web-api]
Expand Down
6 changes: 4 additions & 2 deletions integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use tracing_subscriber::{
Layer,
};
use xayn_test_utils::{asset::ort_target, env::clear_env, workspace::find_workspace_dir};
use xayn_web_api::{config, start, AppHandle, Application, WebApi};
use xayn_web_api::{config::Config, start, AppHandle, Application, WebApi};
use xayn_web_api_db_ctrl::{Silo, Tenant};
use xayn_web_api_shared::{
elastic,
Expand Down Expand Up @@ -625,7 +625,9 @@ where
&format!("inline:{config}"),
];

let config = config::load_with_args([""; 0], args);
let config = Config::load_with_args([""; 0], args)
.finalize(false)
.unwrap();

start::<A>(config)
.instrument(error_span!("test", test_id = %services.test_id))
Expand Down

This file was deleted.

12 changes: 7 additions & 5 deletions integration-tests/tests/legacy_tenant_migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use xayn_integration_tests::{
TEST_EMBEDDING_SIZE,
};
use xayn_test_utils::{asset::ort_target, env::clear_env};
use xayn_web_api::{config, start, Application, WebApi};
use xayn_web_api::{config::Config, start, Application, WebApi};
use xayn_web_api_db_ctrl::{elastic_create_tenant, LegacyTenantInfo, Silo};
use xayn_web_api_shared::{
elastic,
Expand Down Expand Up @@ -306,7 +306,7 @@ fn test_full_migration() {
.await?;
conn.close().await?;

let config = config::load_with_args([""; 0], {
let config = Config::load_with_args([""; 0], {
let config = build_test_config_from_parts_and_names(
WebApi::NAME,
&pg_config,
Expand All @@ -322,11 +322,12 @@ fn test_full_migration() {
"--config",
&format!("inline:{config}"),
]
});
})
.finalize(false)?;
let ingestion = start::<WebApi>(config).await?;
info!("started new ingestion");
let ingestion_url = ingestion.url();
let config = config::load_with_args([""; 0], {
let config = Config::load_with_args([""; 0], {
let config = build_test_config_from_parts_and_names(
WebApi::NAME,
&pg_config,
Expand All @@ -342,7 +343,8 @@ fn test_full_migration() {
"--config",
&format!("inline:{config}"),
]
});
})
.finalize(false)?;
let personalization = start::<WebApi>(config).await?;
info!("started new personalization");
let personalization_url = personalization.url();
Expand Down
1 change: 1 addition & 0 deletions web-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ npyz = "0.8.1"
ouroboros = "0.17.0"
tokio = { workspace = true, features = ["sync"] }
toml = { workspace = true }
trycmd = "0.14.16"
xayn-test-utils = { path = "../test-utils" }

[[bench]]
Expand Down
Loading

0 comments on commit 9061557

Please sign in to comment.