nationalparkservice / EnvironmentalSetting_Toolkit

Tools supporting the NPS IMD Environmental Setting protocol
Other
3 stars 2 forks source link

Start a testing framework #27

Closed llnelson closed 5 years ago

llnelson commented 6 years ago

Doc

llnelson commented 5 years ago

testthat operations generally expect an 'atomic' level for responses... Challenging to test complex data frames returned by Toolkit functions. Can do the component tests like getBBox(), getStationSubtype(), stripEscapes(), getUSHCN(), getAOAFeature(), format*(), etc...

llnelson commented 5 years ago

Priority test targets: getBBox(), getStationSubtype(), getUSHCN(), getAOAFeature(), format*(). Challenge will be specifying appropriate parameter format... Combine with stopifnot() logic.

For master function tests (findStation, etc): check variable count, check variable type/content as analogs for DF structure.

llnelson commented 5 years ago

Added initial test suite focussed on metric requests: test-findStation, test-getWxObservations, test-getWxObservationsDerivedMetrics, test-getStationMetrics, test-getGrids*, and test-getMetricGrids. Run tests in RStudio using Build --> Test Package or via individual test files using test_file(fName)

ToDo: generi-size findStation and getWxObservation tests.

llnelson commented 5 years ago

Merged testdev into dev. Closing issue.