mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Require absolute paths for test SQLite configuration (#34411)
## Why `SqliteConfig` stores its home as an `AbsolutePathBuf`, but its test constructor previously accepted a `PathBuf` and checked the absolute-path invariant at runtime. ## What changed - Make `SqliteConfig::new_for_testing` accept an `AbsolutePathBuf` directly, removing its fallible conversion and `expect`. - Update SQLite test setup to convert temporary directory paths with `PathExt::abs` at each call site. GitOrigin-RevId: 93585b9aea805e2449b3465ac20eeb39417ed555
This commit is contained in:
1 parent
44481a1c45
commit
81e89fa5af
8 files changed
+26
-27
No files matched your search
@@ -158,6 +158,7 @@ mod tests {
|
||||
use super::test_support::unique_temp_dir;
|
||||
use crate::migrations::STATE_MIGRATOR;
|
||||
use crate::state_db_path;
|
||||
use codex_utils_absolute_path::test_support::PathExt;
|
||||
use pretty_assertions::assert_eq;
|
||||
use sqlx::migrate::Migrator;
|
||||
use std::borrow::Cow;
|
||||
@@ -336,7 +337,7 @@ mod tests {
|
||||
table_name: STATE_MIGRATOR.table_name.clone(),
|
||||
create_schemas: STATE_MIGRATOR.create_schemas.clone(),
|
||||
};
|
||||
let pool = crate::SqliteConfig::new_for_testing(codex_home.clone())
|
||||
let pool = crate::SqliteConfig::new_for_testing(codex_home.as_path().abs())
|
||||
.open_read_write_pool(&state_db_path(codex_home.as_path()))
|
||||
.await
|
||||
.expect("open old state db");
|
||||
|
||||
Reference in new issue
Block a user