OCHA-DAP / hdx-signals

HDX Signals
https://un-ocha-centre-for-humanitarian.gitbook.io/hdx-signals/
GNU General Public License v3.0
5 stars 0 forks source link

Add ci to test monitoring scripts #112

Closed hannahker closed 3 months ago

hannahker commented 3 months ago

WIP to address #110.

Some food for thought... would it be worth extending the GMAS_TEST_RUN flag to not call any external APIs? This action could potentially be run quite frequently and I don't love the idea of it making repeated calls to any external systems (could hit rate limits?). What if we stored generated some small dummy datasets that could be the inputs?

I also thought about combining this testing with the existing monitor_{indicator}.yaml scripts, but I like that with this approach we only have to set up the environment once. Open to being convinced otherwise though.

hannahker commented 3 months ago

A couple thoughts:

caldwellst commented 3 months ago

Okay, clear, I think you're right! I think as long as we have warnings flagging as errors, which we do now in our runs, we are going to be covered. So yes, let's make GMAS_TEST_RUN entirely self-contained. I think what we will need to do is just update all raw_{indicator}.R files to redirect to a sample dataset based on that env var.

Should we have the sample data updating in src-static? Could literally just be like filtering data to 2 countries that we know cover different use cases or visuals (e.g. for IPC, we want Afghanistan because it has subnational analyses, and maybe Burkina Faso because it uses CH data).

hannahker commented 3 months ago

Closing in favour of #131