Skip to content

Conversation

@filipchristiansen
Copy link
Contributor

Overview

This PR introduces two new tests to improve coverage for critical functionality in our ingestion and cloning logic:

  1. test_run_ingest_query

    • Ensures that run_ingest_query correctly processes directories, generates the proper summary, and includes file contents in the expected structure.
  2. test_clone_repo_with_timeout

    • Verifies that the clone_repo function raises an AsyncTimeoutError if the cloning process exceeds the specified time limit (via async_timeout).

Details

  • test_run_ingest_query:
    • Uses temp_directory and a sample_query fixture to set up a mock repository structure.
    • Calls run_ingest_query and asserts that the summary and content match the known directory structure.
  • test_clone_repo_with_timeout:
    • Mocks the _run_git_command function to force an asyncio.TimeoutError.
    • Expects the AsyncTimeoutError from our async_timeout decorator, confirming correct timeout handling.

Rationale

  • Expanding test coverage helps ensure reliability and prevent regressions.
  • Verifying the timeout behavior guards against potential hangs or long-running clone operations.

Notes

  • No changes to core functionality; these tests only confirm existing behavior.
  • Includes minor additions to test_query_ingestion.py and test_repository_clone.py.

Please review and let me know if further adjustments or refinements are needed!

@filipchristiansen filipchristiansen force-pushed the test/run-ingest-query-timeout branch from 7d1a467 to 4cb0e1c Compare January 14, 2025 16:49
@cyclotruc cyclotruc merged commit 8137ce1 into main Jan 15, 2025
9 checks passed
@cyclotruc cyclotruc deleted the test/run-ingest-query-timeout branch January 15, 2025 01:12
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.

3 participants