Commit Graph

7 Commits

Author SHA1 Message Date
rishikanthc
377ac4fd12 fixes #232 2025-11-25 09:12:28 -08:00
Geoff Tognetti
cdf95d2b45 Fix unit tests - achieve 7/7 passing test suites
Hi there, I wanted to pull this in to my CI/CD platform and saw your unit tests were due for a refactor, so I did it for you. Enjoy!

## Summary

This PR refactors and fixes all unit tests to achieve 7/7 passing test suites (up from 3/7). The changes validate PR #260's dependency injection pattern and update tests to match the current adapter-based architecture.

## Changes Made

### 1. New Adapter Registration Tests
- Created comprehensive test suite for PR #260's dependency injection pattern
- Tests verify all adapters accept custom envPath parameters
- Validates model storage location fix works correctly
- Tests registry clearing and adapter registration

### 2. Registry Test Helpers
- Added ClearRegistry() - clears all registered adapters for test isolation
- Added GetTranscriptionAdapters() - retrieves all transcription adapters
- Added GetDiarizationAdapters() - retrieves all diarization adapters
- These helpers enable proper testing of adapter registration

### 3. Migrated Tests to New Architecture
Updated three test files to use UnifiedJobProcessor instead of removed WhisperXService:
- tests/security_test.go
- tests/api_handlers_test.go
- Retired tests/transcription_service_test.go (renamed to .old)

### 4. Fixed Queue Test Failures
Fixed 5 failing tests in tests/queue_test.go:
- Updated stats field: "workers" changed to "current_workers" (2 tests)
- Updated mock method: "ProcessJob" changed to "ProcessJobWithProcess" with third parameter (3 tests)

### 5. Test Script Improvements
Enhanced run_tests.sh:
- Added frontend build check and automatic build if needed
- Fixed database cleanup bug using find instead of glob patterns
- Properly captures test exit codes
- Added adapter registration test suite

### 6. API Handler Fixes
Fixed tests/api_handlers_test.go:
- Updated queue stats expectations
- Fixed supported models response (array to map)
- Migrated to UnifiedJobProcessor

## Test Results

Before: 3/7 passing (Security, Auth, LLM)
After: 7/7 passing (all suites)

Test Suites:
1. Security Tests
2. Authentication Service Tests
3. LLM Integration Tests
4. Database Tests
5. Queue Management Tests
6. API Handler Tests
7. Adapter Registration Tests (NEW)
2025-11-18 11:13:53 -08:00
rishikanthc
ce0b85fa23 adds support for video transcription - formatter run touched all files 2025-09-07 18:24:00 -07:00
rishikanthc
c2de028627 fixes job termination 2025-09-01 19:52:43 -07:00
rishikanthc
4c2cda76e4 adds more tests 2025-08-29 10:08:41 -07:00
rishikanthc
513914a6da test ci/cd 2025-08-28 15:19:03 -07:00
rishikanthc
96aeaf1454 basic UI 2025-08-21 15:48:55 -07:00