Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QEP #5: stricter unit tests #7

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions QEP-5-Unit-tests.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.. _qep#[.#]:

==========================================================
QGIS Enhancement #: Compulsory Unit Tests for Core Changes
==========================================================

:Date: 2014/10/05
:Author: Nyall Dawson
:Contact: [email protected]
:Last Edited: 2014/10/05
:Status: Draft
:Version: QGIS 2.7+

.. note::

See :ref:`QEP 1 <qep1>` for description of QEP process.

#. Summary
----------

This proposal is aimed at providing more stable releases and preventing regressions in QGIS releases by expanding
the coverage of unit tests and adopting a hard line approach to compulsory unit tests.

#. Background
-------------

The QGIS coding guidelines (ref) state that since "November 2007 we require all new features going into master to be
accompanied with a unit test" (https://github.com/qgis/QGIS/blob/master/CODING#L738). However, this requirement is not
being enforced and the vast majority of core changes are not accompanied by unit tests. Lack of unit tests impact
on our ability to deliver stable, regression free releases and potentially harms our reputation as an enterprise-ready GIS.

#. Proposed Solution
--------------------

From QGIS >=2.7, all commits which modify code in "core" are required to be accompanied by sufficient unit tests to ensure
that they will not suffer regressions in future QGIS releases. Commits which are not accompanied by unit tests will not be accepted
into master. Code changes for GUI and app are immune from this requirement due to the complexity in writing interactive
tests suites.

Exemption for specific commits may be granted, but only after discussion on the QGIS developer list.

Generally, unit tests in either c++ or python are acceptable (or both). However, methods which involve transfer of ownership
of objects must include python tests to ensure that this transfer is handled correctly.

To enforece this requirement, commits which modify core and which are not accompanied by unit tests (or have been granted
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

exemption via the Dev list) will be reverted. Pull requests without sufficient unit tests will not be considered for merging.


#. Implementation Details
-------------------------

If accepted, the existing requirement for unit tests in the CODING file will be updated to reflect the new requirements. The
new requirements will be advertised to existing developers via an announcement on the QGIS-Dev mailing list.

#. Voting History
-----------------

(required)