diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dac24ef..dd3baf9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,31 +1,55 @@ image: maxking/mailman-ci-runner django-1.8: + stage: test script: - - tox -e py27-django18-coverage - -django-1.9: - script: - - tox -e py27-django19-coverage + - tox -e py27-django18 django-1.10: + stage: test script: - - tox -e py27-django110-coverage + - tox -e py27-django110 django-1.11: + stage: test script: - - tox -e py27-django111-coverage + - tox -e py27-django111 -django-1.11-head: +coverage: + stage: test script: - - tox -e py27-django111-head-coverage - allow_failure: true + - tox -e coverage + artifacts: + paths: + - coverage + expire_in: 5 days pep8: + stage: test script: - tox -e pep8 +django-1.11-git: + stage: test + script: + - tox -e py27-django111-head + allow_failure: true + django-latest: + stage: test script: - tox -e py27-django-latest allow_failure: true + +pages: + stage: deploy + dependencies: + - coverage + script: + - mv coverage/ public/ + artifacts: + paths: + - public + expire_in: 5 days + only: + - master diff --git a/README.rst b/README.rst index f6e7542..ecc4013 100644 --- a/README.rst +++ b/README.rst @@ -7,6 +7,9 @@ .. image:: https://readthedocs.org/projects/postorius/badge :target: https://postorius.readthedocs.io +.. image:: https://gitlab.com/mailman/postorius/badges/master/coverage.svg?job=coverage + :target: https://mailman.gitlab.io/postorius + .. image:: http://img.shields.io/pypi/v/postorius.svg :target: https://pypi.python.org/pypi/postorius diff --git a/src/postorius/doc/development.rst b/src/postorius/doc/development.rst index 41b4138..d57b185 100644 --- a/src/postorius/doc/development.rst +++ b/src/postorius/doc/development.rst @@ -28,6 +28,18 @@ 3. Make a "merge request" to get your code reviewed and merged. +First Contributions / Coverage Reports +====================================== + +If you don't know how you can contribute, +writing tests is a good way to get you started. + +You can start by exploring the existing `test coverage`_ +and finding code that's not covered ie. not tested. + +.. _`test coverage`: https://mailman.gitlab.io/postorius/index.html + + Installing and running the tests ================================ diff --git a/tox.ini b/tox.ini index 1bc1d50..b3e8e60 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27-django{18,19,110,111},pep8 +envlist = py27-django{18,19,110,111}-head,pep8 [testenv] @@ -8,7 +8,6 @@ mock vcrpy beautifulsoup4 - coverage: coverage head: git+https://gitlab.com/mailman/mailmanclient.git head: git+https://gitlab.com/mailman/django-mailman3.git dev,record: -e../mailmanclient @@ -19,14 +18,27 @@ django111: Django>=1.11,<1.12 django-latest: https://github.com/django/django/archive/master.tar.gz commands = - coverage: coverage run example_project/manage.py test --settings=test_settings {posargs:postorius} - coverage: coverage html - coverage: coverage report + python example_project/manage.py test --settings=test_settings {posargs:postorius} setenv = PYTHONPATH = {toxinidir} record: POSTORIUS_VCR_RECORD_MODE = all +[testenv:coverage] +basepython = python2 +deps = + mock + vcrpy + coverage + beautifulsoup4 + git+https://gitlab.com/mailman/mailmanclient.git + git+https://gitlab.com/mailman/django-mailman3.git +commands = + coverage: coverage run example_project/manage.py test --settings=test_settings {posargs:postorius} + coverage: coverage html + coverage: coverage report -m + + [testenv:pep8] basepython = python2 deps =