blob: 6b2f017983ff246c0a2058e5f200dd6788f7d012 [file] [log] [blame]
Fatih Degirmencif4a2bbf2020-01-14 15:59:15 +00001.. _framework-developer-guide:
Fatih Degirmenci66d1e602020-01-13 12:50:03 +00002
Fatih Degirmencif4a2bbf2020-01-14 15:59:15 +00003================================================
4Cloud Infra Automation Framework Developer Guide
5================================================
Fatih Degirmenci89b4f8f2020-01-07 00:08:50 +00006
7Introduction
8============
9
10TBD
11
12Developing New Features
13=======================
14
15TBD
16
17Testing Your Changes
18--------------------
19
20**Static Code Analysis**
21
22Engine bash scripts, Ansible playbooks, and other YAML files are subject
23to static code analysis using various utilities listed below.
24
25* `ansible-lint <https://github.com/ansible/ansible-lint>`_
26* `shellcheck <https://github.com/koalaman/shellcheck>`_
27* `yamllint <https://github.com/adrienverge/yamllint>`_
28
29It is always a good idea to test your changes locally before sending them
30for code review and for further testing in order to receive fastest possible
31feedback and also to avoid unnecessary failures on CI.
32
331. Install python and virtualenv
34
35 | ``sudo apt install -y python3-minimal virtualenv``
36
372. Create and activate virtualenv
38
39 | ``virtualenv -p python3 .venv``
40 | ``source .venv/bin/activate``
41
423. Install test requirements
43
44 | ``pip install -r test-requirements.txt``
45
464. Use tox to run static code analysis
47
48 4a. Run all tests
49
50 | ``tox``
51
52 4b. Run ansible-lint
53
54 | ``tox -e ansible-lint``
55
56 4c. Run shellcheck
57
58 | ``tox -e shellcheck``
59
60 4d. Run yamllint
61
62 | ``tox -e yamllint``
63
64 4e. Run multiple checks using comma seperated list
65
66 | ``tox -e ansible-lint,shellcheck``
67
68References
69==========
70
71TBD