blob: 6b2f017983ff246c0a2058e5f200dd6788f7d012 [file] [log] [blame]
.. _framework-developer-guide:
================================================
Cloud Infra Automation Framework Developer Guide
================================================
Introduction
============
TBD
Developing New Features
=======================
TBD
Testing Your Changes
--------------------
**Static Code Analysis**
Engine bash scripts, Ansible playbooks, and other YAML files are subject
to static code analysis using various utilities listed below.
* `ansible-lint <https://github.com/ansible/ansible-lint>`_
* `shellcheck <https://github.com/koalaman/shellcheck>`_
* `yamllint <https://github.com/adrienverge/yamllint>`_
It is always a good idea to test your changes locally before sending them
for code review and for further testing in order to receive fastest possible
feedback and also to avoid unnecessary failures on CI.
1. Install python and virtualenv
| ``sudo apt install -y python3-minimal virtualenv``
2. Create and activate virtualenv
| ``virtualenv -p python3 .venv``
| ``source .venv/bin/activate``
3. Install test requirements
| ``pip install -r test-requirements.txt``
4. Use tox to run static code analysis
4a. Run all tests
| ``tox``
4b. Run ansible-lint
| ``tox -e ansible-lint``
4c. Run shellcheck
| ``tox -e shellcheck``
4d. Run yamllint
| ``tox -e yamllint``
4e. Run multiple checks using comma seperated list
| ``tox -e ansible-lint,shellcheck``
References
==========
TBD