Documentation Index
Fetch the complete documentation index at: https://docs.cirron.com/llms.txt
Use this file to discover all available pages before exploring further.
cirron test
Run comprehensive tests for your ML projects, including environment validation, model testing, and data pipeline verification.Usage
Options
| Option | Description | Default |
|---|---|---|
--env | Test environment setup (Python, CUDA, dependencies) | false |
--build | Test Docker container build process | false |
--requirements | Validate Python requirements.txt | false |
--unit | Run unit tests (pytest/unittest) | false |
--lint | Code quality checks | false |
--model | Test model loading and instantiation | false |
--data | Test data loading functionality | false |
--inference | Test model inference pipeline | false |
-v, --val | Run validation tests on model accuracy | false |
-p, --path <path> | Path to validation data (used with βval) | auto-detect |
-e, --endpoint <url> | Test deployed endpoint for performance | - |
--pipeline | End-to-end ML pipeline testing | false |
-w, --watch | Watch mode for continuous testing | false |
--json | Output results in JSON format | false |
--strict | Fail fast on any errors (useful for CI) | false |
-i, --interactive | Smart test selection with presets and custom options | false |
Test Types
Environment Tests
- Python version compatibility (checks against
pythonVersionin cirron.yaml) - CUDA availability for GPU projects (if
gpuRequired: true) - Framework-specific GPU checks (PyTorch/TensorFlow)
- Virtual environment detection
Build Tests
- Dockerfile existence
- Docker build success with test image
- Test image cleanup
Requirements Tests
- requirements.txt existence
- Dependency conflict detection via
pip check - Package resolution via dry-run installation
Unit Tests
- pytest (preferred) or unittest discovery
- Test directory existence
- Test execution
Lint Tests
- flake8 (preferred) or pylint execution
- Code style validation
- Source directory checks
Model Tests
src/model.pyfile existencecreate_model()function import and execution- Model method validation (
fit,predict, orforward) - Framework-specific functionality
Data Tests
src/data_loader.pyfile existence- Sample data availability in
data/sample/ - Data loading functionality with sample data
.cirronignorefiltering
Inference Tests
src/inference.pyfile existenceModelInferenceclass instantiation- Model loading from
models/model.joblib - Prediction functionality with real or dummy data
Validation Tests
- Model accuracy on validation data
- Performance metrics (accuracy, MSE, MAE)
- Inference latency and throughput
- Supports CSV files and automatic data path detection
Endpoint Tests
- Endpoint availability and response
- Performance metrics (latency, throughput, success rate)
- Multiple request testing (10 requests by default)
- Error handling and timeout detection
Pipeline Tests
- Complete pipeline execution in sequence
- Environment β Data Loading β Model Creation β Inference β Validation
- Step-by-step timing and success tracking
- Comprehensive pipeline validation
Default Behavior
When no specific tests are specified, runs:- Environment tests
- Requirements tests
- Unit tests
- Model tests
- Data tests
Examples
Basic Testing
Advanced Testing
Test Configuration
Tests are automatically configured based on your project structure. The CLI looks for:- Model tests:
src/model.py(requirescreate_model()function) - Data tests:
src/data_loader.py - Inference tests:
src/inference.py(requiresModelInferenceclass) - Unit tests:
tests/directory - Requirements:
requirements.txt - Build:
Dockerfile
cirron.yaml:
Test Output
Success Output
Failure Output
Watch Mode
Use--watch for development with automatic test re-runs:
src/**/*.pytests/**/*.pycirron.yaml
- Unit tests
- Model tests
- Data tests
- Lint tests
How It Works
Test Execution
- Tests run sequentially with individual error handling
- Each test shows progress with spinner
- Failed tests donβt stop execution of remaining tests
- Results summary shows pass/fail status for each test
Validation Data Detection
- Uses
-ppath if provided - Falls back to
cirron.yamltest configuration - Checks common paths:
data/validation/,data/val/,data/test/,data/sample/ - Supports both single files and directories
- Applies
.cirronignorefiltering
Model Training Integration
- Automatically trains model if no trained model exists
- Uses
train.pywith Trainer class for model training - Saves model to
models/model.joblib - Supports fallback to dummy data for inference tests
Performance Testing
- Endpoint tests measure latency, throughput, and success rate
- Validation tests measure accuracy and inference performance
- Pipeline tests track timing for each step
- All tests have appropriate timeouts
Test Workflows
Development Workflow
CI/CD Workflow
Production Validation
Framework-Specific Tests
The CLI automatically runs framework-specific tests based on your project configuration:PyTorch Tests
- Tests
torch.cuda.is_available()if GPU is required - Tests model forward pass with dummy data
- Validates model structure and methods
TensorFlow Tests
- Tests GPU device availability if required
- Tests model prediction with dummy data
- Validates model methods and interface
Scikit-Learn Tests
- Tests model has required methods (
fit,predict) - Validates model interface and functionality
Test Dependencies
The CLI automatically detects and uses available testing tools:- pytest (preferred) or unittest for unit tests
- flake8 (preferred) or pylint for code quality
- Docker for build tests
- pip for requirements validation
- requests for endpoint testing
- pandas for data validation