Skip to content

Commit 369926c

Browse files
devwhodevsclaude
andcommitted
test: integration tests with fixture vault
Add 8 integration tests (all #[ignore]) that exercise the full index-search pipeline using lower-level APIs with isolated temp directories. Create lib.rs to expose modules for integration test access. Fixture vault includes 4 notes + excluded .obsidian dir. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f8efee4 commit 369926c

8 files changed

Lines changed: 482 additions & 7 deletions

File tree

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pub mod chunker;
2+
pub mod config;
3+
pub mod embedder;
4+
pub mod hnsw;
5+
pub mod indexer;
6+
pub mod search;
7+
pub mod store;

src/main.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
mod chunker;
2-
mod config;
3-
mod embedder;
4-
mod hnsw;
5-
mod indexer;
6-
mod search;
7-
mod store;
1+
use engraph::config;
2+
use engraph::indexer;
3+
use engraph::search;
4+
use engraph::store;
85

96
use anyhow::Result;
107
use clap::{Parser, Subcommand};

tests/fixtures/.obsidian/config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Obsidian Config
2+
This should be excluded from indexing.

tests/fixtures/note1.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
tags: [rust, programming]
3+
---
4+
5+
# Rust Error Handling
6+
7+
## Using Result
8+
9+
The Result type is Rust's primary error handling mechanism.
10+
11+
## Using thiserror
12+
13+
The thiserror crate provides derive macros for custom error types.

tests/fixtures/note2.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
tags: [python, scripting]
3+
---
4+
5+
# Python Basics
6+
7+
## Variables
8+
9+
Python uses dynamic typing for variables.
10+
11+
## Functions
12+
13+
Functions are defined with the def keyword.

tests/fixtures/note3.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Quick Notes
2+
3+
Just a plain note without frontmatter or sections. Contains some text about machine learning and neural networks.

tests/fixtures/subfolder/note4.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
tags: [devops]
3+
---
4+
5+
# Docker Guide
6+
7+
## Building Images
8+
9+
Use Dockerfile to define container images.

0 commit comments

Comments
 (0)