Skip to content

Conversation

@gitauto-ai
Copy link
Contributor

@gitauto-ai gitauto-ai bot commented Dec 1, 2025

Resolves #1992

Summary

Add comprehensive unit tests for services/supabase/llm_requests/clear_old_content.py to validate deletion of stale LLM request content across success, edge, and error paths.

Test Patterns

  • Deletes rows strictly older than cutoff; preserves newer or boundary (equal to cutoff) rows
  • No-op when dataset is empty or no rows meet criteria
  • All-eligible scenario: deletes all when everything is older than cutoff
  • Cutoff sourcing:
    • Explicit cutoff datetime argument
    • Retention days from environment/config
    • Missing/invalid retention config falls back to default or raises as expected
  • Timezone handling and boundary conditions (naive vs aware timestamps; off-by-one second)
  • Batched/paginated deletion behavior (if implemented) processes all pages
  • Supabase client failures (select/delete errors) are surfaced/handled appropriately
  • Idempotency: repeated runs after deletion do not remove additional rows
  • Returns expected status/count and emits expected logs/metrics
git fetch origin
git checkout gitauto/issue-1992-20251201-000024-g9kg
git pull origin gitauto/issue-1992-20251201-000024-g9kg

@gitauto-ai gitauto-ai bot requested a review from hiroshinishio as a code owner December 1, 2025 00:01
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.

Schedule: Add unit tests to services/supabase/llm_requests/clear_old_content.py

1 participant