traitecoevo/traits.build

Make `austraits` package functions part of workflow or testing

Closed this issue · 3 comments

Brought to my attention by @ehwenk:

Currently there is no testing to check that the austraits functions join_..., as_wide_table, etc. work on the austraits output. This would be useful, as there have been previous releases where there have been issues in the data preventing as_wide_table from working.

@ehwenk Thinking about it a bit more, I'm a bit confused how this would work. Is the aim of this to make sure the austraits functions work as intended, or whether the data doesn't have issues in it, assuming that the austraits functions work as intended?

If this is added as a test within traits.build, it would only test whether the austraits functions work on the test datasets. In order to test if a final database output doesn't have any issues in it, couldn't we just run dataset_test() on the whole database and check no failures + everything pivots wider?

ehwenk commented

The assumption is that unless the workflow changes, it is an error within a dataset. It is therefore a test that should either be part of testdata.R or a test that runs on a fully built database?

I see this as an extension of the errors that are now being quickly picked up by the pivot test, that previously only appeared when we sporadically tried to use austraits pivot functions. It would be more efficient than suddenly discovering, as I did today, that a function like join_contexts is no longer working.

Yeah I think testdata.R would work well.

I'm not too sure of a place where a test would run on a fully built database. Maybe here, after AusTraits is built.

I've added the tests but it seems they are failing because austraits functions are not fully functional yet. I've tried using the changes-for-v5-austraits.build branch but there's still treatment_id instead of treatment_context_id in the branch.

So leaving this branch on hold for now.