Skip to main content

cirron test

Run comprehensive tests for ML projects: environment validation, model testing, data pipeline verification, inference, deployed endpoint checks, and end-to-end pipelines.

Usage

Options

OptionDescriptionDefault
--envTest environment setup (Python, CUDA, dependencies)false
--buildTest Docker container build processfalse
--requirementsValidate Python requirements.txtfalse
--unitRun unit tests (pytest/unittest)false
--lintCode quality checks (flake8/pylint)false
--modelTest model loading and instantiationfalse
--dataTest data loading functionalityfalse
--inferenceTest model inference pipelinefalse
-v, --valRun validation tests on model accuracyfalse
-p, --path <path>Path to validation data (used with --val)auto-detect
-e, --endpoint <url>Test deployed endpoint for performance-
--pipelineEnd-to-end ML pipeline testingfalse
-w, --watchWatch mode for continuous testingfalse
--jsonOutput results in JSON formatfalse
--strictFail fast on any errors (useful for CI)false
-i, --interactiveSmart test selection with presetsfalse
When no specific test flags are passed, the default suite runs --env, --requirements, --unit, --model, and --data.

Test Types

TestFlagWhat it checks
Environment--envPython version (vs. pythonVersion in cirron.yaml), CUDA availability for gpuRequired: true, framework-specific GPU checks, virtual env detection
Build--buildDockerfile exists, Docker build succeeds on a test image, then cleans up
Requirements--requirementsrequirements.txt exists, no dependency conflicts (pip check), dry-run install
Unit--unitDiscovers and runs pytest (preferred) or unittest in tests/
Lint--lintRuns flake8 (preferred) or pylint; validates style
Model--modelsrc/model.py exists, create_model() imports and runs, model exposes fit / predict / forward
Data--datasrc/data_loader.py exists, sample data available in data/sample/, loads under .cirronignore filtering
Inference--inferencesrc/inference.py exists, ModelInference instantiates, loads models/model.joblib, predicts with real or dummy data
Validation--val [-p PATH]Accuracy/MSE/MAE on validation data, inference latency and throughput; CSV files, auto-detects common paths
Endpoint--endpoint <url>Endpoint availability, latency, throughput, success rate (10 requests by default), timeout handling
Pipeline--pipelineRuns environment → data loading → model creation → inference → validation in sequence with per-step timing
Framework-specific behavior is applied automatically based on framework in cirron.yaml:
  • PyTorch: torch.cuda.is_available() when GPU is required, forward pass with dummy data, model structure and methods.
  • TensorFlow: GPU device availability, prediction with dummy data, model interface.
  • Scikit-Learn: presence of fit / predict, model interface.

Examples

Configuration

The CLI detects tests from your project structure (src/model.py with create_model(), src/data_loader.py, src/inference.py with ModelInference, tests/, requirements.txt, Dockerfile) and from cirron.yaml:
Validation data path resolution: -p flag → cirron.yaml config → common paths (data/validation/, data/val/, data/test/, data/sample/). Honors .cirronignore. If no trained model exists, the inference test will automatically train via train.py (Trainer class) and save to models/model.joblib.

Test Output

Tests run sequentially with per-test error handling. Failures don’t stop the suite.

Watch Mode

--watch watches src/**/*.py, tests/**/*.py, and cirron.yaml, automatically re-running unit, model, data, and lint tests on change.

Test Dependencies

Auto-detected: pytest (preferred) or unittest, flake8 (preferred) or pylint, Docker, pip, requests, pandas.

Troubleshooting

Error / SymptomResolution
Model file not foundEnsure src/model.py with create_model() exists
Data loader file not foundCreate src/data_loader.py
Inference file not foundCreate src/inference.py with ModelInference class
Tests directory not foundCreate tests/ directory with test files
Python version check failedEnsure local Python matches pythonVersion in cirron.yaml
CUDA not available but requiredRun nvidia-smi; verify gpuRequired in cirron.yaml
Docker build failedEnsure Docker daemon is running
No linter foundpip install flake8 (or pylint)
No validation data foundPass -p or configure test.dataPaths in cirron.yaml
Validation data is emptyVerify CSV content and .cirronignore filtering

CI/CD