Skip to content

Commit

Permalink
Merge pull request #1582 from digitalfabrik/enhancement/docs
Browse files Browse the repository at this point in the history
Add testing documentation
  • Loading branch information
timobrembeck committed Jun 30, 2022
2 parents f418c94 + da7d9f4 commit 839ceea
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sphinx/continuous-integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ tests
This job runs the tests in 16 parallel containers. It sets up a temporary postgres database and runs the migrations
before testing. It runs pytest and passes the coverage in the ``test-results`` directory to the build artifacts.

.. _circleci-upload-test-coverage:

upload-test-coverage
--------------------

Expand Down
2 changes: 2 additions & 0 deletions sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ Basic Concepts
virtualenv
internationalization
frontend-bundling
testing
documentation
continuous-integration

* :doc:`virtualenv`: Virtual Python environment and Pipenv
* :doc:`internationalization`: Multi-language support for the backend UI
* :doc:`frontend-bundling`: Work on frontend assets
* :doc:`testing`: How to test this application
* :doc:`documentation`: This Sphinx documentation
* :doc:`continuous-integration`: Continuous Integration and Delivery with CircleCI

Expand Down
30 changes: 30 additions & 0 deletions sphinx/testing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
****************
Testing (Pytest)
****************


We use :doc:`pytest <pytest:index>` to validate that the functionality of the cms works as expected.

In addition, we use the following plugins:

* :doc:`pytest-cov <pytest-cov:index>`: This plugin produces coverage reports.
* :doc:`pytest-django <pytest-django:index>`: Provide a few helpers for Django
* :doc:`pytest-xdist:index`: Enable distributing tests across multiple CPUs to speed up test execution

For more information, see :doc:`topics/testing/index` and :doc:`topics/testing/overview`.

For reference of our test framework and test cases, see :mod:`tests`.


Coverage
========

After each run, the test coverage is uploaded to `CodeClimate <https://codeclimate.com/github/digitalfabrik/integreat-cms>`__ (see :ref:`circleci-upload-test-coverage`).


Test API with WebApp
====================

To test the API in the web app with a different CMS server, open the JavaScript console of the web app and execute::

window.localStorage.setItem('api-url', 'https://cms-test.integreat-app.de')

0 comments on commit 839ceea

Please sign in to comment.