<commit_before>Build Tools
===========

Coverage Report
---------------

 Test coverage report helps you to analyse the code covered by your unit tests.

 FogLAMP uses `pytest-cov <http://pytest-cov.readthedocs.io/en/latest/readme.html>`_ (pytest plugin for coverage reporting) to check the code coverage.

How to run Test Coverage (through make)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- ``make py-test`` : This installs required dependencies, run python tests and generates coverage report in html format.
- ``make cov-report`` : Opens coverage report htmlcov/index.php in your default browser

How to read coverage report
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- index.html page displays the test coverage of all the files

  .. image:: images/coverage_report.png

- To see the details of file, click on the file hyperlink, this will navigate you to the file details which shows the code covered (in green) and code not covered (in red) by the unit tests

  .. image:: images/coverage_report_file_details.png

How to modify configuration of coverage
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 Default configuration of coverage report is stored in the file ``.coveragerc`` . If you want to include tests in your code coverage, remove ``/*/tests/*`` from the omit option.



Test Report
-----------

 FogLAMP uses `Allure <http://allure.qatools.ru/>`_ to visualise the test reports.

Prerequisite
^^^^^^^^^^^^

 Install allure on your local machine. Use instructions listed `here <http://wiki.qatools.ru/display/AL/Allure+Commandline>`_

 `Note:` Unable to locate package allure-commandline for Ubuntu users. See `link <https://stackoverflow.com/questions/34772906/unable-to-install-allure-cli-on-ubuntu-15-10>`_

How to generate Allure Report (through make)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- ``make py-test`` : This installs required dependencies, run python tests.
- ``make test-report``: This generates allure reports, Starting web server for report directory <allure-report> and displays the report in your browser.
- To stop the web server and exit, press ``Ctrl+C`` from your terminal.
<commit_msg>Added doc commands usage in build-tools.rst<commit_after>Build Tools
===========

Coverage Report
---------------

 Test coverage report helps you to analyse the code covered by your unit tests.

 FogLAMP uses `pytest-cov <http://pytest-cov.readthedocs.io/en/latest/readme.html>`_ (pytest plugin for coverage reporting) to check the code coverage.

How to run Test Coverage (through make)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- ``make py-test`` : This installs required dependencies, run python tests and generates coverage report in html format.
- ``make cov-report`` : Opens coverage report htmlcov/index.php in your default browser

How to read coverage report
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- index.html page displays the test coverage of all the files

  .. image:: images/coverage_report.png

- To see the details of file, click on the file hyperlink, this will navigate you to the file details which shows the code covered (in green) and code not covered (in red) by the unit tests

  .. image:: images/coverage_report_file_details.png

How to modify configuration of coverage
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 Default configuration of coverage report is stored in the file ``.coveragerc`` . If you want to include tests in your code coverage, remove ``/*/tests/*`` from the omit option.



Test Report
-----------

 FogLAMP uses `Allure <http://allure.qatools.ru/>`_ to visualise the test reports.

Prerequisite
^^^^^^^^^^^^

 Install allure on your local machine. Use instructions listed `here <http://wiki.qatools.ru/display/AL/Allure+Commandline>`_

 `Note:` Unable to locate package allure-commandline for Ubuntu users. See `link <https://stackoverflow.com/questions/34772906/unable-to-install-allure-cli-on-ubuntu-15-10>`_

How to generate Allure Report (through make)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- ``make py-test`` : This installs required dependencies, run python tests.
- ``make test-report``: This generates allure reports, Starting web server for report directory <allure-report> and displays the report in your browser.
- To stop the web server and exit, press ``Ctrl+C`` from your terminal.



Documentation
-------------

 FogLAMP uses `Shphinx <http://www.sphinx-doc.org/en/stable/>`_ for documentation. Additionally it uses sphinx.ext.autodoc and sphinx.ext.ifconfig extensions in the project.

How to generate documentation for your source code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 HTML docs are generated from source code docstrings in directory FogLAMP/src/python/foglamp and its subsequent directories using sphinx-apidoc.
 Make use of the following make commands to work with docs.

- ``make doc`` - generates .rst files from your source code and then generates html docs from .rst files present in /docs directory.
- ``make live-doc`` - generates .rst files from your source code and then generates html docs from .rst files present in /docs directory. You can monitor live changes in your source code docstings with this option.
- ``make doc-build-test`` - run docs/check-sphinx tests. Run this command to ensure the .rst files generated are correct and docstrings in your source code are as per PEP8 guidelines.

{'fraction_non_alphanumeric': 0.1587990936555891, 'fraction_numerical': 0.004720543806646525, 'mean_word_length': 4.323618090452261, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6571346', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1404, 'n_words': 612}