Unverified Commit 42ca5c63 authored by Zhang, Chen's avatar Zhang, Chen Committed by GitHub
Browse files

Merge pull request #280 from ornlneutronimaging/doc_integration_test_data_setup

update docs on setup integration test data
parents 096cfefd 70f09f68
Loading
Loading
Loading
Loading
+20 −8
Original line number Diff line number Diff line
@@ -6,9 +6,21 @@ The Data Repository
===================

Integration tests will typically require data from the **data repository**
located in `iMars3D/tests/data/imars3d-data/` as a
located in ``iMars3D/tests/data/imars3d-data/`` as a
`git submodule <https://git-scm.com/book/en/v2/Git-Tools-Submodules>`_.

TL;DR
-----

Perform the following steps after cloning the repo and ``cd`` to the root of the repo:

- ``sudo apt install git-lfs``  (if not already installed)
- ``git submodule init``
- ``git submodule update``

Now you should have the integration test data downloaded to ``iMars3D/tests/data/imars3d-data/``.
If you are interested in how it is configured, please continue reading.

Git Submodule
-------------

@@ -19,17 +31,17 @@ Git Submodule

**typical commands:**

Here, "submodule" refers to repo `imars3d-data` and "parent" refers to repo `imars3d`
Here, "submodule" refers to repo ``imars3d-data`` and "parent" refers to repo ``imars3d``

- checkout the submodule after cloning the parent with command `git submodule init`
- find the refspec stored in the parent with command `git ls-tree $(git branch --show-current) tests/data/imars3d-data`
- synchronize the submodule to the refspec stored in the parent with command `git submodule update`
- after making commits in the sumodule, synchronize the refspec stored in the parent with commands `git add...` and `git commit...`
- checkout the submodule after cloning the parent with command ``git submodule init``
- find the refspec stored in the parent with command ``git ls-tree $(git branch --show-current) tests/data/imars3d-data``
- synchronize the submodule to the refspec stored in the parent with command ``git submodule update``
- after making commits in the sumodule, synchronize the refspec stored in the parent with commands ``git add...` and `git commit...``

Pytest Fixtures
===============

Pytest fixtures in `conftest.py` providing directories frequently accessed:
Pytest fixtures in ``conftest.py`` providing directories frequently accessed:

+--------------+----------------------------------------------------------------------------+
| Fixture      | Value (as a `pathlib.Path` object)                                         |
@@ -42,7 +54,7 @@ Pytest fixtures in `conftest.py` providing directories frequently accessed:
Writing Test Functions
======================

Test functions accessing `DATA_DIR` should be marked with the `datarepo` marker
Test functions accessing ``DATA_DIR`` should be marked with the ``datarepo`` marker

.. code:: python