mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-23 09:18:36 +02:00
fix: all tests now in sync
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use super::types::StoredObject;
|
||||
use crate::{
|
||||
error::AppError,
|
||||
storage::{indexes::ensure_runtime_indexes, types::system_settings::SystemSettings},
|
||||
};
|
||||
use axum_session::{SessionConfig, SessionError, SessionStore};
|
||||
use axum_session_surreal::SessionSurrealPool;
|
||||
|
||||
@@ -120,7 +120,7 @@ async fn ensure_hnsw_index(
|
||||
)
|
||||
.await
|
||||
}
|
||||
HnswIndexState::Matches(_) => Ok(()),
|
||||
HnswIndexState::Matches => Ok(()),
|
||||
HnswIndexState::Different(existing) => {
|
||||
info!(
|
||||
index = spec.index_name,
|
||||
@@ -182,7 +182,7 @@ async fn hnsw_index_state(
|
||||
};
|
||||
|
||||
if current_dimension == expected_dimension as u64 {
|
||||
Ok(HnswIndexState::Matches(current_dimension))
|
||||
Ok(HnswIndexState::Matches)
|
||||
} else {
|
||||
Ok(HnswIndexState::Different(current_dimension))
|
||||
}
|
||||
@@ -190,7 +190,7 @@ async fn hnsw_index_state(
|
||||
|
||||
enum HnswIndexState {
|
||||
Missing,
|
||||
Matches(u64),
|
||||
Matches,
|
||||
Different(u64),
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ impl SystemSettings {
|
||||
mod tests {
|
||||
use crate::storage::types::{knowledge_entity::KnowledgeEntity, text_chunk::TextChunk};
|
||||
use async_openai::Client;
|
||||
use crate::storage::indexes::ensure_runtime_indexes;
|
||||
|
||||
use super::*;
|
||||
use uuid::Uuid;
|
||||
@@ -325,6 +326,11 @@ mod tests {
|
||||
.await
|
||||
.expect("Failed to load current settings");
|
||||
|
||||
// Ensure runtime indexes exist with the current embedding dimension so INFO queries succeed.
|
||||
ensure_runtime_indexes(&db, current_settings.embedding_dimensions as usize)
|
||||
.await
|
||||
.expect("failed to build runtime indexes");
|
||||
|
||||
let initial_chunk_dimension = get_hnsw_index_dimension(
|
||||
&db,
|
||||
"text_chunk_embedding",
|
||||
|
||||
Reference in New Issue
Block a user