# Testing before committing Running tests locally before pushing reduces CI failures and speeds up the review cycle. ## Check your Python version OSM requires Python 3.10+: ```bash python -V # Python 3.10.x ``` You can manage Python versions with [pyenv](https://github.com/pyenv/pyenv). ## Install dependencies in a virtual environment ```bash cd python -m venv .venv source .venv/bin/activate # On Windows PowerShell: .venv\Scripts\Activate.ps1 pip install -r requirements.txt -r requirements-dev.txt -r requirements-test.txt ``` ## Run the test suite From the project folder, run: ```bash ./devops-stages/stage-test.sh ``` This is equivalent to running `tox` directly in most projects. It covers: - Code format checks - Linting (pylint, flake8) - Unit tests with coverage ## Run Robot (E2E) tests For more complex changes, you can run the full E2E sanity suite locally using the `opensourcemano/tests` Docker image: ```bash docker run --rm=true --name tests -t --env-file envconfig.rc \ -v ~/.config/openstack/clouds.yaml:/etc/openstack/clouds.yaml \ -v ~/tests/reports:/robot-systest/reports \ opensourcemano/tests:testing-daily \ -t sanity ``` See the [tests repository README](https://osm.etsi.org/gitlab/osm/tests/-/blob/master/README.md) for details on configuring `envconfig.rc` and available test tags.