feat: add unit tests and contribution guide#183
Open
Shreyansh1729 wants to merge 2 commits intoVectifyAI:mainfrom
Open
feat: add unit tests and contribution guide#183Shreyansh1729 wants to merge 2 commits intoVectifyAI:mainfrom
Shreyansh1729 wants to merge 2 commits intoVectifyAI:mainfrom
Conversation
- Add Dockerfile and docker-compose.yml for containerized usage (closes VectifyAI#137) - Add .dockerignore to keep build context lean - Add pytest-based unit tests for utils.py (48 tests) and retrieve.py (16 tests) - Add CONTRIBUTING.md with development setup and PR guidelines
Collaborator
|
@Shreyansh1729 No idea why we need docker? It will be a pip library instead of a service. |
Author
|
Thanks for the feedback @KylinMountain That makes sense — PageIndex is a library, not a service, so Docker isn't the right fit here. I'll remove the Docker files (Dockerfile, docker-compose.yml, .dockerignore) from this PR. The remaining changes — unit tests (64 tests for utils.py and retrieve.py) and CONTRIBUTING.md — are still useful independently. Would you like me to keep those in this PR, or split them into separate PRs? |
PageIndex is a library, not a service — Docker containerization is not the right fit. Keeping unit tests and CONTRIBUTING.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a comprehensive unit test suite and contribution guidelines to improve the project's code quality and developer experience.
Changes Made
pageindex/utils.py(JSON extraction, tree manipulation, node ID assignment, filename sanitization, structure formatting)pageindex/retrieve.pyRoot Cause
The project had zero automated tests and no contribution guidelines, which are barriers for maintaining code quality and onboarding new contributors.
Testing
All 64 tests pass:
All tests exercise pure functions only — no LLM API calls or network access required.
Usage