This is an automated email from the ASF dual-hosted git repository.
sunithabeeram pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 46e593d Update contribution guidelines (#4012)
46e593d is described below
commit 46e593d13412d64ed5e6543ee13ba24e3558f7b4
Author: Sunitha Beeram <[email protected]>
AuthorDate: Tue Mar 26 09:32:05 2019 -0700
Update contribution guidelines (#4012)
* Update contribution guidelines
* Further updates
* contribution_guidelines.rst
---
docs/contribution_guidelines.rst | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/docs/contribution_guidelines.rst b/docs/contribution_guidelines.rst
index f4a4b47..d0f20a6 100644
--- a/docs/contribution_guidelines.rst
+++ b/docs/contribution_guidelines.rst
@@ -28,7 +28,7 @@ Before you begin to contribute, make sure you have reviewed
:ref:`dev-setup` and
Create a design document
------------------------
If your change is relatively minor, you can skip this step. If you are
-adding new major feature, we suggest that you add a design document
+adding new major feature, we suggest that you add a design document
and solicit comments from the community before submitting any code.
`Here <https://cwiki.apache.org/confluence/display/PINOT/Design+Documents>`_
@@ -120,6 +120,12 @@ Be cautious about pulling in external dependencies. You
will need to consider mu
Testing your changes
^^^^^^^^^^^^^^^^^^^^
+Automated tests are always recommended for contributions. Make sure you write
tests so that:
+
+#. You verify the correctness of your contribution. This serves as proof to
you as well as the reviewers.
+
+#. You future proof your contributions against code refactors or other
changes. While this may not always be possible (see :ref:`testing-guidelines`),
its a good goal to aim for.
+
Identify a list of tests for the changes you have made. Depending on the scope
of changes, you may need one or more of the following tests:
* Unit Tests
@@ -127,6 +133,14 @@ Identify a list of tests for the changes you have made.
Depending on the scope o
Make sure your code has the necessary class or method level unit tests. It
is important to write both positive case as well as negative case tests.
Document your tests well and add meaningful assertions in the tests; when
the assertions fail, ensure that the right messages are logged with information
that allows other to debug.
+
+* Integration Tests
+
+ Add integration tests to cover End-to-End paths without relying on *mocking*
(see note below). You ``MUST`` add integration tests for REST APIs, and must
include tests that cover different error codes; i.e., 200 OK, 4xx or 5xx errors
that are explicit contracts of the API.
+
+.. _testing_guidelines:
+Testing Guidelines
+^^^^^^^^^^^^^^^^^^
* Mocking
Use `Mockito <https://site.mockito.org/>`_ to mock classes to control
specific behaviors - e.g., simulate various error conditions.
@@ -138,6 +152,7 @@ Identify a list of tests for the changes you have made.
Depending on the scope o
Make sure that adequate asserts are added in the tests to verify that the
tests are passing for the right reasons.
+
* Write reliable tests
Make sure you are writing tests that are reliable. If the tests depend on
asynchronous events to be fired, do not add ``sleep`` to your tests. Where
possible, use appropriate mocking or condition based triggers.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]