Skip to main content

Module test_api

Module test_api 

Source
Expand description

API Testing Tools for VoiRS Server

This module provides comprehensive API testing functionality for the VoiRS HTTP server. It includes endpoint validation, performance measurements, authentication testing, and detailed test reporting.

§Features

  • Endpoint Testing: Test all server endpoints (health, voices, synthesize, stats)
  • Authentication: Validate API key authentication mechanisms
  • Performance Metrics: Measure response times, throughput, latency
  • Contract Validation: Verify API responses match expected schemas
  • Test Reports: Generate detailed JSON/Markdown test reports
  • Load Testing: Basic concurrent request testing

§Usage

# Test server at localhost:8080
voirs test-api localhost:8080

# Test with API key authentication
voirs test-api localhost:8080 --api-key YOUR_KEY

# Generate detailed report
voirs test-api localhost:8080 --report report.json

# Run load test
voirs test-api localhost:8080 --load-test --concurrent 10

Structs§

ApiTestConfig
API test configuration
ApiTestReport
Complete API test report
ApiTester
API tester
EndpointTestResult
Test result for a single endpoint
LoadTestResults
Load test results
TestStatistics
Test statistics summary

Functions§

print_report
Print test report to console
run_api_tests
Run API tests with the given configuration