Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide study test utilities #219

Open
mikix opened this issue Apr 22, 2024 · 2 comments
Open

Provide study test utilities #219

mikix opened this issue Apr 22, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@mikix
Copy link
Contributor

mikix commented Apr 22, 2024

It might be nice to encourage unit tests in studies and provide some tooling for it.

In the hypertension study (and still-WIP data-metrics study), I've got a little test harness method that runs a study on some ndjson and compares the resulting tables against some csvs.

Super basic, but pretty useful. We could copy that into the Library, as a starting block.

@dogversioning
Copy link
Contributor

Some discussion around this for posterity:

  • don't perscribe a test framework other than what's in the standard lib - but hooks for test frameworks are fine, and should be set up in a reuseable way
  • The method reference in the above comment is a good starting point for a generalized, holistic runner
  • It may also be nice to provide a version of the mock_db/mock_db_config functions in the library as part of an importable testing module for more targeted/incremental testing

@mikix
Copy link
Contributor Author

mikix commented Aug 21, 2024

Matt and I just had a quick slack convo about this and I wanted to mention that we both are leaning away from exposing a way to create raw resource tables (like the Library testbed or the data-metrics harness do) and towards mocking/creating the core tables directly if we can.

Faster certainly, and also easier to mock edge cases directly.

Maybe its API looks similar to the testbed class (e.g. add_patient()), but it would just operate on the core tables instead of raw tables.

@dogversioning dogversioning added this to the Testing framework milestone Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants