FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: add unit tests for ClassicRAG chunk distribution and token budg… by ManasKumar111 · Pull Request #2681 · arc53/DocsGPT · GitHub

/ DocsGPT Public

test: add unit tests for ClassicRAG chunk distribution and token budg… - #2681

Open
ManasKumar111 wants to merge 1 commit into
arc53:mainfrom
ManasKumar111:test/classic-rag-chunk-logic
Open

ManasKumar111 wants to merge 1 commit into
arc53:mainfrom
ManasKumar111:test/classic-rag-chunk-logic

Conversation

Copy link
Copy Markdown

What

Adds unit tests for ClassicRAG._get_data() covering chunk distribution, token budget enforcement, and the base_chunks override behavior — previously untested logic in application/retriever/classic_rag.py.

Tests added

  • Chunk ceiling bound (max(chunks, num_sources)) in both directions (chunks < sources, chunks > sources)
  • base_chunks override behavior (Dispatcher-set class attribute vs. fallback to self.chunks)
  • Token budget enforcement — retrieval stops once cumulative tokens approach the limit
  • search() correctly delegates to _get_data()

Why

No test file existed for classic_rag.py. This logic governs how many documents actually reach the LLM prompt, so incorrect behavior here directly affects retrieval quality.

How tested

All 5 tests run and passing inside the Docker backend container:

docker compose -f deployment/docker-compose.yaml exec backend python3 -m pytest tests/retriever/test_classic_rag.py -v

Result: 5 passed, 0 failed

Type of change

  • Test coverage addition

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

@ManasKumar111 is attempting to deploy a commit to the Arc53 Team on Vercel.

A member of the Team first needs to authorize it.

github-actions Bot added the tests Tests label Aug 16, 2026
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

Labels

tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL