Add isolated rmcp Tools adapter prototype
CI / Rust Checks (pull_request) Failing after 40s
CI / Rust Feature Validation (pull_request) Skipped
CI / UI Checks (pull_request) Successful in 12s
CI / Frontend E2E (pull_request) Skipped
CI / Community Image Smoke (pull_request) Skipped
CI / Required Checks (pull_request) Failing after 2s
CI / Deploy (pull_request) Skipped
CI / Rust Checks (pull_request) Failing after 40s
CI / Rust Feature Validation (pull_request) Skipped
CI / UI Checks (pull_request) Successful in 12s
CI / Frontend E2E (pull_request) Skipped
CI / Community Image Smoke (pull_request) Skipped
CI / Required Checks (pull_request) Failing after 2s
CI / Deploy (pull_request) Skipped
This commit is contained in:
1 parent
e4953abcd2
commit
1c256e6c75
17 files changed
+1978
-91
No files matched your search
@@ -19,11 +19,20 @@ struct TestPostgres {
|
||||
}
|
||||
|
||||
pub async fn postgres_database_url() -> &'static str {
|
||||
&test_postgres().await.database_url
|
||||
&test_postgres("local-tests").await.database_url
|
||||
}
|
||||
|
||||
pub async fn postgres_schema_url(prefix: &str) -> String {
|
||||
let database_url = postgres_database_url().await;
|
||||
create_schema_url(prefix, database_url).await
|
||||
}
|
||||
|
||||
/// The first caller owns the process-wide disposable PostgreSQL container.
|
||||
pub async fn postgres_schema_url_for_task(prefix: &str, task: &str) -> String {
|
||||
create_schema_url(prefix, &test_postgres(task).await.database_url).await
|
||||
}
|
||||
|
||||
async fn create_schema_url(prefix: &str, database_url: &str) -> String {
|
||||
let schema = unique_schema_name(prefix);
|
||||
let mut connection = connect_admin_with_retry(database_url).await;
|
||||
|
||||
@@ -73,22 +82,26 @@ pub fn unique_schema_name(prefix: &str) -> String {
|
||||
format!("{}_{}", normalized_prefix, uuid::Uuid::now_v7().simple())
|
||||
}
|
||||
|
||||
async fn test_postgres() -> &'static TestPostgres {
|
||||
async fn test_postgres(task: &str) -> &'static TestPostgres {
|
||||
POSTGRES
|
||||
.get_or_init(|| async {
|
||||
tokio::task::spawn_blocking(start_postgres)
|
||||
let task = task.to_owned();
|
||||
tokio::task::spawn_blocking(move || start_postgres(task))
|
||||
.await
|
||||
.expect("test PostgreSQL container startup task must complete")
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
fn start_postgres() -> TestPostgres {
|
||||
fn start_postgres(task: String) -> TestPostgres {
|
||||
let container = Postgres::default()
|
||||
.with_db_name("crank")
|
||||
.with_user("crank")
|
||||
.with_password("crank")
|
||||
.with_tag("16-alpine")
|
||||
.with_label("hermes.disposable", "true")
|
||||
.with_label("hermes.task", task)
|
||||
.with_label("hermes.board", "crank")
|
||||
.start()
|
||||
.expect("test PostgreSQL container must start");
|
||||
register_container_cleanup(container.id().to_owned());
|
||||
|
||||
Reference in new issue
Block a user