Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.6.0
NL→SQL Leaderboard Tests
This directory contains all test files for the NL→SQL Leaderboard project.
Test Structure
test/
├── __init__.py # Test package initialization
├── conftest.py # Pytest configuration and fixtures
├── test_config.py # Configuration loading tests
├── test_evaluation.py # Evaluation pipeline tests
├── test_models.py # Model testing utilities
├── test_system.py # System integration tests
└── README.md # This file
Running Tests
Quick Test Run
python run_tests.py
Using pytest directly
# Run all tests
pytest test/
# Run specific test file
pytest test/test_config.py
# Run with coverage
pytest test/ --cov=src --cov-report=html
# Run only fast tests
pytest test/ -m "not slow"
Test Categories
- Unit Tests: Fast, isolated tests for individual components
- Integration Tests: Tests that verify component interactions
- System Tests: End-to-end tests of the complete system
Test Configuration
Tests are configured to run in mock mode by default:
MOCK_MODE=true- Uses mock SQL generationHF_TOKEN=""- Prevents real API calls- All external dependencies are mocked
Test Fixtures
mock_mode: Ensures mock mode is enabledtest_data_dir: Path to test data directoryconfig_dir: Path to configuration directory
Writing New Tests
- Create test files with
test_*.pynaming - Use descriptive test function names starting with
test_ - Use fixtures from
conftest.pywhen needed - Mark slow tests with
@pytest.mark.slow - Use proper assertions and error messages
Test Coverage
The test suite aims for comprehensive coverage:
- Configuration loading and validation
- Model registry functionality
- Evaluation pipeline
- Scoring and metrics
- UI components
- Error handling
Continuous Integration
Tests are designed to run in CI/CD environments:
- No external dependencies required
- Mock mode prevents API calls
- Fast execution for quick feedback
- Comprehensive coverage reporting