Skip to content

[BUG] Missing Negative Test Coverage for Backend APIs #65

Open

Description

@SrishtiSonam

Bug Description

What is the problem?

Most backend tests currently check only the successful (happy-path) cases.
In real usage, external services like GitHub API, Gemini AI, and FAISS can fail, timeout, or return unexpected data.

These failure scenarios are currently not covered by tests.

Steps to Reproduce

  1. Call backend APIs with an invalid or expired GitHub token
  2. Simulate an empty or malformed response from GitHub or Gemini
  3. Trigger a network timeout or service failure
  4. Observe that failures are not properly handled or tested

Expected Behavior

The backend should:

  • Handle failures gracefully
  • Return clear and safe error responses
  • Have test cases that validate this behavior

Actual Behavior

Failure scenarios are not tested, which may lead to:

  • Silent crashes
  • Unclear error responses
  • Bugs appearing only in production

Component

Backend

Environment

Backend (FastAPI, AI services, FAISS)
Backend service (environment-independent)

Additional Context

This issue focuses only on adding test coverage.
No API behavior or features will be changed.
I’d like to work on this issue as part of SWoC — please assign it to me if approved.

Activity

  1. added
    bugSomething isn't working
    SWoC26Social Winter of Code 2026
    on Jan 3, 2026
  2. github-actions commented on Jan 3, 2026

    @github-actions

    Thank you for creating this issue! 🎉

    This issue is part of Social Winter of Code 2026.

    Next Steps:

    • A maintainer will review and assign difficulty labels (Easy/Medium/Hard)
    • Feel free to ask questions in the comments
    • Wait for assignment before starting work

    Happy contributing! 🚀

  3. AvishkarPatil commented on Jan 3, 2026

    @AvishkarPatil
    Owner

    Hey @SrishtiSonam , Valid issue - accepted! This is important for production reliability, but please prioritize after rate limiting (#66) is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

EasyGood for beginnersSWOCPart of Social Winter of CodeSWoC26Social Winter of Code 2026bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions