Skip to content

🧪 [testing improvement] Add unit tests for build_index in index-vault.py#11

Merged
masuda-so merged 2 commits into
mainfrom
test-index-vault-3442137096001501526
Apr 13, 2026
Merged

🧪 [testing improvement] Add unit tests for build_index in index-vault.py#11
masuda-so merged 2 commits into
mainfrom
test-index-vault-3442137096001501526

Conversation

@masuda-so
Copy link
Copy Markdown
Owner

🎯 What: The testing gap for the build_index function inside scripts/index-vault.py was addressed. This complex function interacts with both the filesystem and an internal SQLite database, requiring tests to validate behavior like note scanning, directory exclusions, metadata extraction, and incremental update logic.

📊 Coverage:
The newly added suite in scripts/tests/test_index_vault.py tests several critical scenarios:

  • Basic Indexing: Scanning valid directories, ignoring explicitly skipped ones, and verifying metadata insertion.
  • Incremental Indexing: Tests incremental=True behavior, capturing state changes for unmodified, updated, added, and deleted files.
  • Non-incremental Sync: Ensures files removed from the filesystem are dropped from the database when doing a full rebuild.
  • Permissions Failure Resilience: Handles files throwing OSError (e.g. unreadable permission setup) gracefully.
  • Content Extraction Logic: Mocks a note with full frontmatter structure, nested links, and markdown callouts to ensure title, tags, summaries, and lengths are accurately processed.

Result: Test coverage improved specifically on index-vault's core functionality. Tests execute securely in isolated temporary directories ensuring zero side effects, making future refactors much more confident and secure against bugs.


PR created automatically by Jules for task 3442137096001501526 started by @masuda-so

… function

Co-authored-by: masuda-so <258961222+masuda-so@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…137096001501526

# Conflicts:
#	scripts/tests/test_index_vault.py
@masuda-so masuda-so merged commit f52dbfb into main Apr 13, 2026
1 check passed
@masuda-so masuda-so deleted the test-index-vault-3442137096001501526 branch April 13, 2026 02:25
masuda-so added a commit that referenced this pull request May 10, 2026
… function (#11)

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: masuda-so <258961222+masuda-so@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant