Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Generate code coverage
run: |
Expand All @@ -29,7 +29,7 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Archive code coverage results
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: tarpaulin-report.html
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ uuid = { version = "1.3", features = ["v4", "serde"] }
qdrant-client = "1.4"
toml = "0.8"
dirs = "5.0"
deadpool = "0.9"
backoff = { version = "0.4", features = ["tokio"] }
async-trait = "0.1"
regex = "1.10"
lazy_static = "1.4"

[dev-dependencies]
tempfile = "3.5"
Empty file added TEST_PLAN.md
Empty file.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pub mod api;
pub mod vector_store;
pub mod config;
pub mod app;
pub mod mcp;
pub mod text_processing;

pub use server::Server;
pub use cli::{Cli, Args};
Expand Down
47 changes: 47 additions & 0 deletions src/mcp/mock.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
use crate::vector_store::{Document, SearchQuery, SearchResult, VectorStore, VectorStoreError};
use async_trait::async_trait;

/// Mock implementation of the EmbeddedQdrantConnector for testing
pub struct MockQdrantConnector;

impl MockQdrantConnector {
/// Create a new mock connector
pub fn new() -> Self {
Self
}
}

#[async_trait]
impl VectorStore for MockQdrantConnector {
async fn test_connection(&self) -> Result<(), VectorStoreError> {
Ok(())
}

async fn create_collection(&self, _name: &str, _vector_size: usize) -> Result<(), VectorStoreError> {
Ok(())
}

async fn delete_collection(&self, _name: &str) -> Result<(), VectorStoreError> {
Ok(())
}

async fn insert_document(&self, _collection: &str, _document: Document) -> Result<(), VectorStoreError> {
Ok(())
}

async fn search(&self, _collection: &str, _query: SearchQuery) -> Result<Vec<SearchResult>, VectorStoreError> {
// Return a mock result
let doc = Document {
id: "test-id".to_string(),
content: "Test document".to_string(),
embedding: vec![0.0; 384],
};

let result = SearchResult {
document: doc,
score: 0.95,
};

Ok(vec![result])
}
}
Loading