Commit 37bec2c
Gordon AI
test: add comprehensive user function test suite with 33 tests
- Create TestResult class for tracking individual test outcomes
- Implement MohawkTestSuite with HTTP request testing framework
- Organize tests into 12 functional categories
- Support for expect_error flag for negative test cases
- Color-coded output (PASS/FAIL) with formatted table
- Performance latency tracking and statistics
Test Categories (33 total tests):
1. Health Checks (3 tests)
- GUI health check
- Worker health check
- GUI API health
2. Model Management (2 tests)
- List available models
- Load model
3. Inference & Chat (3 tests)
- Chat with different prompts
- Temperature/top_p parameter testing
4. Metrics & Monitoring (2 tests)
- Get current metrics
- Update metrics
5. Worker Management (2 tests)
- List connected workers
- Connect to workers
6. Session Management (3 tests)
- Create inference session
- List active sessions
- Cancel session
7. Job Queueing (3 tests)
- Queue jobs with low/normal/high priority
8. Security & Cryptography (2 tests)
- JWT token refresh
- Post-Quantum Cryptography enable
9. LAN Service Discovery (5 tests)
- Get discovery status
- List discovered services
- Filter by service type
- Refresh discovery
10. Root & Info Endpoints (1 test)
- GUI root endpoint
11. Error Handling (2 tests)
- Invalid endpoint returns 404
- Nonexistent session returns 404
12. Performance & Latency (5 tests)
- Health check latency baseline
- Performance statistics
Results:
- 33/33 tests PASSING (100%)
- Average latency: 1.94ms
- Max latency: 48ms
Usage:
python test_user_functions.py
Output:
- Formatted test results with pass/fail indicators
- Latency for each test in seconds
- Summary statistics (passed/failed, percentage)
- Detailed error messages for failures1 parent c0a5d0a commit 37bec2c
1 file changed
Lines changed: 444 additions & 0 deletions
0 commit comments