You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/02 15:52:26 UTC

[GitHub] [arrow] thisisnic commented on a change in pull request #11827: ARROW-14758: [Doc] Steps in making your first PR - test in Python

thisisnic commented on a change in pull request #11827:
URL: https://github.com/apache/arrow/pull/11827#discussion_r761141305



##########
File path: docs/source/developers/guide/step_by_step/testing.rst
##########
@@ -29,3 +29,68 @@
 ***********
 Testing 🧪
 ***********
+
+In Arrow we always add a unit test to the code we are
+contributing. Therefore you will also need to add one when
+you finish with your work.

Review comment:
       I think it's a good idea to introduce this section, but I think that perhaps this could be rephrased a little.  The point being made is an important one, but there are circumstances in which it's not true - if someone is making a change to existing code which requires modifying of existing tests (not adding them), or making a change to a part of the codebase which doesn't involve testing (e.g. documentation, or a listing script, or something else).  And it might not be one test - one code change could lead to multiple tests.

##########
File path: docs/source/developers/guide/step_by_step/testing.rst
##########
@@ -29,3 +29,68 @@
 ***********
 Testing 🧪
 ***********
+
+In Arrow we always add a unit test to the code we are
+contributing. Therefore you will also need to add one when
+you finish with your work.
+
+.. tabs::
+
+   .. tab:: Pytest
+
+      We use `pytest <https://docs.pytest.org/en/latest/>`_ for
+      unit tests in Python. For more info about the required
+      packages follow
+      :ref:`Python unit testing section <python-unit-testing>`.
+
+      What we normally do is run the test we are working on
+      only. Once we are finished with our work and then 
+      we run other tests also.
+
+      To run a specific unit test use this command in 
+      the terminal from the ``arrow/python`` folder:
+
+      .. code-block::
+
+         python -m pytest pyarrow/tests/test_file.py -k test_your_unit_test
+
+      Run all the tests from one file:
+
+      .. code-block::
+
+         python -m pytest pyarrow/tests/test_file.py
+
+      Run all the tests:
+
+      .. code-block::
+
+         python -m pytest pyarrow
+
+      If the tests start failing try to recompile
+      PyArrow or C++.
+      
+      .. note::
+
+         **Recompiling Cython**
+
+         If you change only the .py file you do not need to
+         recompile PyArrow. But you have to that if you make
+         changes in .pyx or .pxd files.

Review comment:
       ```suggestion
            If you only make changes to `.py` files, you do not need to
            recompile PyArrow. However, you should recompile it if you make
            changes in `.pyx` or `.pxd` files.
   ```
   

##########
File path: docs/source/developers/guide/step_by_step/testing.rst
##########
@@ -29,3 +29,68 @@
 ***********
 Testing 🧪
 ***********
+
+In Arrow we always add a unit test to the code we are
+contributing. Therefore you will also need to add one when
+you finish with your work.
+
+.. tabs::
+
+   .. tab:: Pytest
+
+      We use `pytest <https://docs.pytest.org/en/latest/>`_ for
+      unit tests in Python. For more info about the required
+      packages follow
+      :ref:`Python unit testing section <python-unit-testing>`.
+
+      What we normally do is run the test we are working on
+      only. Once we are finished with our work and then 
+      we run other tests also.
+
+      To run a specific unit test use this command in 
+      the terminal from the ``arrow/python`` folder:

Review comment:
       ```suggestion
         To run a specific unit test, use this command in 
         the terminal from the ``arrow/python`` folder:
   ```

##########
File path: docs/source/developers/guide/step_by_step/testing.rst
##########
@@ -29,3 +29,68 @@
 ***********
 Testing 🧪
 ***********
+
+In Arrow we always add a unit test to the code we are
+contributing. Therefore you will also need to add one when
+you finish with your work.
+
+.. tabs::
+
+   .. tab:: Pytest
+
+      We use `pytest <https://docs.pytest.org/en/latest/>`_ for
+      unit tests in Python. For more info about the required
+      packages follow
+      :ref:`Python unit testing section <python-unit-testing>`.
+
+      What we normally do is run the test we are working on
+      only. Once we are finished with our work and then 
+      we run other tests also.
+
+      To run a specific unit test use this command in 
+      the terminal from the ``arrow/python`` folder:
+
+      .. code-block::
+
+         python -m pytest pyarrow/tests/test_file.py -k test_your_unit_test
+
+      Run all the tests from one file:
+
+      .. code-block::
+
+         python -m pytest pyarrow/tests/test_file.py
+
+      Run all the tests:
+
+      .. code-block::
+
+         python -m pytest pyarrow
+
+      If the tests start failing try to recompile
+      PyArrow or C++.

Review comment:
       ```suggestion
         If the tests start failing, try to recompile
         PyArrow or C++.
   ```

##########
File path: docs/source/developers/guide/step_by_step/testing.rst
##########
@@ -29,3 +29,68 @@
 ***********
 Testing 🧪
 ***********
+
+In Arrow we always add a unit test to the code we are
+contributing. Therefore you will also need to add one when
+you finish with your work.
+
+.. tabs::
+
+   .. tab:: Pytest
+
+      We use `pytest <https://docs.pytest.org/en/latest/>`_ for
+      unit tests in Python. For more info about the required
+      packages follow
+      :ref:`Python unit testing section <python-unit-testing>`.
+
+      What we normally do is run the test we are working on
+      only. Once we are finished with our work and then 
+      we run other tests also.

Review comment:
       ```suggestion
         During the development process, it can be more efficient to only run the tests relevant to the code which you are working on.  However, you should run all of the tests once you have finished your development work.
   ```
   How about this?

##########
File path: docs/source/developers/guide/step_by_step/testing.rst
##########
@@ -29,3 +29,68 @@
 ***********
 Testing 🧪
 ***********
+
+In Arrow we always add a unit test to the code we are
+contributing. Therefore you will also need to add one when
+you finish with your work.
+
+.. tabs::
+
+   .. tab:: Pytest
+
+      We use `pytest <https://docs.pytest.org/en/latest/>`_ for
+      unit tests in Python. For more info about the required
+      packages follow
+      :ref:`Python unit testing section <python-unit-testing>`.
+
+      What we normally do is run the test we are working on
+      only. Once we are finished with our work and then 
+      we run other tests also.
+
+      To run a specific unit test use this command in 
+      the terminal from the ``arrow/python`` folder:
+
+      .. code-block::
+
+         python -m pytest pyarrow/tests/test_file.py -k test_your_unit_test
+
+      Run all the tests from one file:
+
+      .. code-block::
+
+         python -m pytest pyarrow/tests/test_file.py
+
+      Run all the tests:
+
+      .. code-block::
+
+         python -m pytest pyarrow
+
+      If the tests start failing try to recompile
+      PyArrow or C++.
+      
+      .. note::
+
+         **Recompiling Cython**
+
+         If you change only the .py file you do not need to
+         recompile PyArrow. But you have to that if you make
+         changes in .pyx or .pxd files.
+        
+         To do that run this command again:
+
+         .. code-block::
+
+            python setup.py build_ext --inplace
+
+      .. note::
+		
+         **Recompiling C++**
+
+         Similarly you will need to recompile C++ if you have
+         done some changes in C++ files. In this case
+         re-run the cmake commands again. 

Review comment:
       ```suggestion
            Similarly, you will need to recompile the C++ code if you have
            made changes to any C++ files. In this case,
            re-run the cmake commands again. 
   ```
   
   Would it be worth mentioning the file extensions for C++ files here?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org