Spaces:
Sleeping
Sleeping
File size: 2,146 Bytes
acd8e16 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | # 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
```bash
python run_tests.py
```
### Using pytest directly
```bash
# 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 generation
- `HF_TOKEN=""` - Prevents real API calls
- All external dependencies are mocked
## Test Fixtures
- `mock_mode`: Ensures mock mode is enabled
- `test_data_dir`: Path to test data directory
- `config_dir`: Path to configuration directory
## Writing New Tests
1. Create test files with `test_*.py` naming
2. Use descriptive test function names starting with `test_`
3. Use fixtures from `conftest.py` when needed
4. Mark slow tests with `@pytest.mark.slow`
5. 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
|