Skip to content

[codex] Isolate Parakeet prerecorded test imports#7940

Open
tianmind-studio wants to merge 1 commit into
BasedHardware:mainfrom
tianmind-studio:codex/windows-parakeet-cachetools-stub
Open

[codex] Isolate Parakeet prerecorded test imports#7940
tianmind-studio wants to merge 1 commit into
BasedHardware:mainfrom
tianmind-studio:codex/windows-parakeet-cachetools-stub

Conversation

@tianmind-studio

Copy link
Copy Markdown
Contributor

Summary

  • Add lightweight cachetools.TTLCache, utils.other.endpoints.timeit, and Prometheus metric stubs inside test_parakeet_prerecorded.py.
  • Keep the Parakeet prerecorded batch STT tests runnable in a lightweight Windows backend unit venv without importing Firebase auth, cachetools, or Prometheus just to collect the test.
  • Preserve the real backend package paths and existing Parakeet/Scipy/WebSocket stubs already used by this file.

Root cause

test_parakeet_prerecorded.py already stubs most of the heavy STT dependencies, but importing utils.stt.pre_recorded still imports utils.byok and utils.other.endpoints. In a lightweight Windows unit-test environment without the full backend requirements installed, collection failed before any Parakeet assertions ran:

  • python -m pytest backend\tests\unit\test_parakeet_prerecorded.py --collect-only -q --tb=short -> ModuleNotFoundError: No module named 'cachetools'

After fixing collection, the streaming factory subtests also imported utils.async_tasks, so the test needs a tiny Prometheus stub unless the full requirements or the shared Prometheus test fallback are already present.

Validation

  • python -m pytest backend\tests\unit\test_parakeet_prerecorded.py --collect-only -q --tb=short -> 31 tests collected
  • python -m pytest backend\tests\unit\test_parakeet_prerecorded.py -q --tb=short -> 31 passed
  • python -m pytest backend\tests\unit\test_action_item_date_validation.py backend\tests\unit\test_parakeet_prerecorded.py -q --tb=short -> 57 passed
  • python -m black --check --line-length 120 --skip-string-normalization backend\tests\unit\test_parakeet_prerecorded.py
  • python -m py_compile backend\tests\unit\test_parakeet_prerecorded.py
  • git diff --check
  • scripts/pre-commit

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.

1 participant