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:
Adam Perry @ OpenAI authored and copyberry committed 2026-07-20 20:54:08 +00:00
1 parent 44481a1c45
commit 81e89fa5af
8 files changed
+26 -27

No files matched your search

+5 -5
View File
@@ -745,6 +745,7 @@ where
mod tests {
use super::*;
use codex_protocol::ThreadId;
use codex_utils_absolute_path::test_support::PathExt;
use pretty_assertions::assert_eq;
use tempfile::TempDir;
@@ -1348,11 +1349,10 @@ mod tests {
async fn insert_thread_row(&self, id: &str, rollout_path: &Path, archived: bool) {
let state_db_path = codex_state::state_db_path(self.sqlite_home.path());
let pool =
codex_state::SqliteConfig::new_for_testing(self.sqlite_home.path().to_path_buf())
.open_read_write_pool(&state_db_path)
.await
.expect("sqlite pool");
let pool = codex_state::SqliteConfig::new_for_testing(self.sqlite_home.path().abs())
.open_read_write_pool(&state_db_path)
.await
.expect("sqlite pool");
sqlx::query(
r#"
INSERT INTO threads (