epiforecasts / NCoVUtils

Utility functions for the 2019-NCoV outbreak
https://epiforecasts.io/NCoVUtils/
Other
27 stars 13 forks source link

datasource tests #68

Closed hamishgibbs closed 4 years ago

hamishgibbs commented 4 years ago

Starting to add tests to check that datasources stay the same. These are likely to break more often but will alert us to any data type changes for data coming from external sources.

At the moment they test that all the columns we expect are present and will therefore not break with additional columns being added. Although it would be good to periodically check data sources as many have continued to add new data.

The motivation for these tests is that get_canada_regional_cases() broke silently and there was a risk that the number of tests could have been arbitrarily renamed as the number of confirmed cases (which would be misleading). Instead, it returned all NA values and failed a different test.

@seabbs, I am not sure how to best structure these tests and if it is acceptable to add a custom test function in the tests folder as I have done. Just let me know and I will change if there is an issue with how I have gone about this.

hamishgibbs commented 4 years ago

I believe build failing because of slow url for get_interventions_data