PondiB / openeocubes

A lightweight R-based RESTful service to analyze Earth Observation data cubes in the cloud.
Apache License 2.0
30 stars 9 forks source link

add tests for ml processes #95

Open MichaelBrueggemann opened 8 months ago

MichaelBrueggemann commented 8 months ago

What

This PR adds a first draft for a bigger "testing suite" for openeocubes. With outsourcing the functions (operations) from it's Processes as suggested in #91 we are now able to unittest each function. This requires that each function is exposed to the NAMESPACE of openeocubes. This is secured by annotating the function with the flag "#' @export". This enables roxygen to add this function to the NAMESPACE of openeocubes.

HINT! When developing a new feature, use devtools::document() to automatically update the descriptions in DESCRIPTION and NAMESPACE

Currently only train_model_opp and apply_prediction_opp are tested, but this schema can be extended to every other operation of openeocubes.

In addtion to the sole unittests, also a "stopping mechanism" is implemented in the local starting script startLocal.R. This prevents the start of the server if any of the unittests should fail.

Why

Unittesting is crucial in any software development. This adds a suitable system to achieve unittesting in openeocubes.