fix(ci): repair baseline checks

This commit is contained in:
t8y2
2026-08-13 03:31:36 +00:00
parent 68733fbf51
commit 01e67ee9a4
9 changed files with 71 additions and 34 deletions
+36 -10
View File
@@ -1620,7 +1620,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -1647,6 +1647,20 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8eb564c5c7423d25c886fb561d1e4ee69f72354d16918afa32c08811f6b6a55"
[[package]]
name = "fast-socks5"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d09fe4a491909a716088083eeb5bcc25427330fdbcd4ecd3dfa5469b3da795df"
dependencies = [
"anyhow",
"async-trait",
"log",
"thiserror 1.0.69",
"tokio",
"tokio-stream",
]
[[package]]
name = "fastrand"
version = "2.5.0"
@@ -2241,7 +2255,7 @@ dependencies = [
"js-sys",
"log",
"wasm-bindgen",
"windows-core 0.62.2",
"windows-core 0.57.0",
]
[[package]]
@@ -3032,6 +3046,7 @@ dependencies = [
"bson",
"derive-where",
"derive_more",
"fast-socks5",
"futures-core",
"futures-io",
"futures-util",
@@ -3082,7 +3097,7 @@ dependencies = [
[[package]]
name = "mysql-common-derive"
version = "0.32.2"
source = "git+https://github.com/t8y2/rust_mysql_common.git?rev=77085e91e5081309d585153e3b656ce33bc1fe74#77085e91e5081309d585153e3b656ce33bc1fe74"
source = "git+https://github.com/t8y2/rust_mysql_common.git?rev=47740d85a8277167a5717afac785d37b46a36296#47740d85a8277167a5717afac785d37b46a36296"
dependencies = [
"darling",
"heck",
@@ -3099,7 +3114,7 @@ dependencies = [
[[package]]
name = "mysql_async"
version = "0.37.0"
source = "git+https://github.com/t8y2/mysql_async.git?rev=2be6e392eb9b06d20dcd2d8ed8eae748d413c9ec#2be6e392eb9b06d20dcd2d8ed8eae748d413c9ec"
source = "git+https://github.com/t8y2/mysql_async.git?rev=b615bb0b10b5975182a4aa069cabc3d09021f6ab#b615bb0b10b5975182a4aa069cabc3d09021f6ab"
dependencies = [
"bytes",
"crossbeam-queue",
@@ -3128,7 +3143,7 @@ dependencies = [
[[package]]
name = "mysql_common"
version = "0.38.0"
source = "git+https://github.com/t8y2/rust_mysql_common.git?rev=77085e91e5081309d585153e3b656ce33bc1fe74#77085e91e5081309d585153e3b656ce33bc1fe74"
source = "git+https://github.com/t8y2/rust_mysql_common.git?rev=47740d85a8277167a5717afac785d37b46a36296#47740d85a8277167a5717afac785d37b46a36296"
dependencies = [
"base64 0.22.1",
"bitflags 2.13.1",
@@ -3215,7 +3230,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -3894,7 +3909,7 @@ dependencies = [
"once_cell",
"socket2",
"tracing",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -4451,7 +4466,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys 0.12.1",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -5256,7 +5271,7 @@ dependencies = [
"getrandom 0.4.3",
"once_cell",
"rustix 1.1.4",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -5520,6 +5535,17 @@ dependencies = [
"tokio",
]
[[package]]
name = "tokio-stream"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3d06f0b082ba57c26b79407372e57cf2a1e28124f78e9479fe80322cf53420b"
dependencies = [
"futures-core",
"pin-project-lite",
"tokio",
]
[[package]]
name = "tokio-util"
version = "0.7.19"
@@ -6078,7 +6104,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
+1 -1
View File
@@ -40,7 +40,7 @@ uuid = { version = "1", features = ["v4"] }
tokio-postgres = { git = "https://github.com/t8y2/tokio-postgres-gaussdb.git", rev = "115f9fef10f0fc3669b5337955e4eb461fc349a6" }
postgres-types = { git = "https://github.com/t8y2/tokio-postgres-gaussdb.git", rev = "115f9fef10f0fc3669b5337955e4eb461fc349a6" }
postgres-protocol = { git = "https://github.com/t8y2/tokio-postgres-gaussdb.git", rev = "115f9fef10f0fc3669b5337955e4eb461fc349a6" }
mysql_async = { git = "https://github.com/t8y2/mysql_async.git", rev = "2be6e392eb9b06d20dcd2d8ed8eae748d413c9ec" }
mysql_async = { git = "https://github.com/t8y2/mysql_async.git", rev = "b615bb0b10b5975182a4aa069cabc3d09021f6ab" }
[profile.release]
panic = "abort"
+2 -2
View File
@@ -50,8 +50,8 @@ mod tests {
let con = duckdb::Connection::open_in_memory().expect("connect in-memory DuckDB");
con.execute_batch("CREATE TABLE users (id INTEGER, name VARCHAR)").expect("create table");
let inserted = duckdb_execute(&con, "INSERT INTO users VALUES (1, 'Ada') RETURNING id, name")
.expect("insert returning");
let inserted =
duckdb_execute(&con, "INSERT INTO users VALUES (1, 'Ada') RETURNING id, name").expect("insert returning");
let updated = duckdb_execute(&con, "UPDATE users SET name = 'Ada Lovelace' RETURNING id, name")
.expect("update returning");
let deleted = duckdb_execute(&con, "DELETE FROM users RETURNING id, name").expect("delete returning");
@@ -238,12 +238,7 @@ describe("SubscriptionsPanel Kafka absolute offset reset", () => {
buttonWithExactText(panel, "mqSubscriptions.reset").click();
await flushUi();
expect(backend.mqResetCursor).toHaveBeenCalledWith(
"mq-1",
expect.objectContaining({ topic: "events" }),
"orders-consumer",
{ kind: "partitionOffset", partition: 1, offset: 42 },
);
expect(backend.mqResetCursor).toHaveBeenCalledWith("mq-1", expect.objectContaining({ topic: "events" }), "orders-consumer", { kind: "partitionOffset", partition: 1, offset: 42 });
});
it.each([
@@ -271,10 +271,7 @@ describe("tableStructureEditorState", () => {
});
it("keeps a saved Oracle length unit when refreshed metadata omits it", () => {
const [legacyAgentDraft] = createColumnDrafts(
[{ name: "DISPLAY_NAME", data_type: "VARCHAR2(255)", is_nullable: true, column_default: null, is_primary_key: false, extra: null }],
"oracle",
);
const [legacyAgentDraft] = createColumnDrafts([{ name: "DISPLAY_NAME", data_type: "VARCHAR2(255)", is_nullable: true, column_default: null, is_primary_key: false, extra: null }], "oracle");
const [restored] = restoreCharacterLengthUnitsAfterSave("oracle", [legacyAgentDraft!], new Map([["display_name", "VARCHAR2(255 CHAR)"]]));
+1 -6
View File
@@ -232,12 +232,7 @@ export interface ProducerInfo {
clientVersion: string;
}
export type ResetPosition =
| { kind: "earliest" }
| { kind: "latest" }
| { kind: "timestamp"; timestampMs: number }
| { kind: "partitionOffset"; partition: number; offset: number }
| { kind: "messageId"; ledgerId: number; entryId: number };
export type ResetPosition = { kind: "earliest" } | { kind: "latest" } | { kind: "timestamp"; timestampMs: number } | { kind: "partitionOffset"; partition: number; offset: number } | { kind: "messageId"; ledgerId: number; entryId: number };
export type SkipCount = { kind: "all" } | { kind: "count"; count: number };
+9
View File
@@ -1082,6 +1082,15 @@ mod tests {
Ok(config)
}
async fn duplicate_connection_for_mcp(
&self,
_source_id: &str,
_copy_id: &str,
_copy_name: &str,
) -> Result<ConnectionConfig, String> {
Err("not exercised".to_string())
}
async fn remove_connection_for_mcp(&self, _connection_id: &str) -> Result<bool, String> {
Ok(true)
}
+18 -3
View File
@@ -1,4 +1,6 @@
use std::{ffi::OsString, sync::Arc};
#[cfg(feature = "duckdb-sidecar")]
use std::ffi::OsString;
use std::sync::Arc;
use dbx_core::{models::connection::ConnectionConfig, storage::Storage};
use dbx_mcp::{DbxBackend, DbxMcpServer, LocalBackend, McpScope};
@@ -6,11 +8,13 @@ use rmcp::{model::CallToolRequestParams, ServiceExt};
use serde_json::{json, Map, Value};
use tempfile::tempdir;
#[cfg(feature = "duckdb-sidecar")]
struct EnvVarGuard {
name: &'static str,
original: Option<OsString>,
}
#[cfg(feature = "duckdb-sidecar")]
impl EnvVarGuard {
fn set(name: &'static str, value: &str) -> Self {
let original = std::env::var_os(name);
@@ -19,6 +23,7 @@ impl EnvVarGuard {
}
}
#[cfg(feature = "duckdb-sidecar")]
impl Drop for EnvVarGuard {
fn drop(&mut self) {
if let Some(value) = self.original.take() {
@@ -378,6 +383,18 @@ async fn local_backend_uses_the_installed_duckdb_sidecar() {
#[tokio::test]
async fn legacy_read_only_config_applies_before_settings_are_opened() {
const CHILD_ENV: &str = "DBX_MCP_LEGACY_READ_ONLY_TEST_CHILD";
if std::env::var_os(CHILD_ENV).is_none() {
let status = std::process::Command::new(std::env::current_exe().expect("locate test executable"))
.args(["--exact", "legacy_read_only_config_applies_before_settings_are_opened", "--nocapture"])
.env(CHILD_ENV, "1")
.env("DBX_MCP_ALLOW_WRITES", "0")
.status()
.expect("run legacy read-only test in an isolated process");
assert!(status.success(), "isolated legacy read-only test failed");
return;
}
let directory = tempdir().expect("temporary data directory");
let db_path = directory.path().join("dbx.db");
let storage = Storage::open(&db_path).await.expect("open storage");
@@ -395,8 +412,6 @@ async fn legacy_read_only_config_applies_before_settings_are_opened() {
}))
.expect("minimal connection config");
storage.save_connections(&[connection]).await.expect("save connection");
let _allow_writes = EnvVarGuard::set("DBX_MCP_ALLOW_WRITES", "0");
let backend = Arc::new(LocalBackend::open(&db_path).await.expect("open local backend"));
let server = DbxMcpServer::with_runtime_options(backend, McpScope::default(), false);
let (server_transport, client_transport) = tokio::io::duplex(16 * 1024);
+2 -2
View File
@@ -363,8 +363,8 @@ mod tests {
impl TestDirectory {
fn new(name: &str) -> Self {
let task_tmp = std::env::var("DBX_TEST_TMP_DIR").expect("DBX_TEST_TMP_DIR");
let path = PathBuf::from(task_tmp).join(format!("dbx-saved-sql-{name}-{}", uuid::Uuid::new_v4()));
let task_tmp = std::env::var_os("DBX_TEST_TMP_DIR").map(PathBuf::from).unwrap_or_else(std::env::temp_dir);
let path = task_tmp.join(format!("dbx-saved-sql-{name}-{}", uuid::Uuid::new_v4()));
std::fs::create_dir_all(&path).unwrap();
Self(path)
}