USACE / cumulus

Cumulus project issue tracking and project planning
MIT License
3 stars 2 forks source link

[FEATURE REQUEST]: Add Unittest for Each Geoprocess Plugin #267

Closed brettpalmberg closed 2 years ago

brettpalmberg commented 2 years ago

Feature Request Type

Add testing approach using python unittest for each geoprocessor in async_geoprocess. This will provide the framework for developers to confidently add new data products and detect changes/updates in grid format or metadata for a given product that may cause the original geoprocessor as-developed to stop working.

For all future product additions, having unit tests will be required for merge to develop branch. This is an important step for our team and for potentially adding contributors to the project in the future.

brettpalmberg commented 2 years ago

@jeffsuperglide, thanks for your foundational work on this. I'll help carry this the last yard 🏈 and close this one out.

Please commit and push existing work here:

jeffsuperglide commented 2 years ago

Test data added: https://github.com/USACE/cumulus-geoproc-test-data

cc @brettpalmberg, @adamscarberry

jeffsuperglide commented 2 years ago

Unit test for geo-processors added to https://github.com/USACE/cumulus-geoproc/feature/unit-tests

cc @brettpalmberg, @adamscarberry

brettpalmberg commented 2 years ago

Awesome, thanks @jeffsuperglide. I'll take a look and start to incorporate into the build. This will really help.

brettpalmberg commented 2 years ago

Working concept with cursory usage documentation in README.md at develop branch here. Additional refinements, test cases, sample files are still needed but sharing a "hello world" version now. Feedback on the approach is most welcome.

jeffsuperglide commented 2 years ago

@brettpalmberg - Dockerfile doesn't need to pip install those packages if the package itself is installed. Copy over the top level directory (cumulus-geoproc) and install.

COPY . .
RUN python -m pip install /cumulus-geoproc/

setup.cfg defines the package directory

[options]
package_dir =
    = src
adamscarberry commented 2 years ago

COPY cumulus-geoproc-test-data/fixtures/ /src/tests/integration/fixtures/

There is no fixtures dir after first clone.

Needed to use: git clone --recursive https://github.com/USACE/cumulus-geoproc.git

brettpalmberg commented 2 years ago

Vast majority of processors have been added to default test suite or a custom test suite. Cross-reference is below. Separating any remaining unit test coverage needs into separate issues by product, planned for milestone FY23-Q1. Some products will not be added to default test suite and do not have a corresponding separate issue in the checklist below.

Integration Test Coverage