Closed vigji closed 8 months ago
Agreed, this is a major issue. I recommend at least starting with some smoke tests for the most important functionalities/workflows.
Thanks for the suggestions! To address this, we have now added tests (https://github.com/calebweinreb/SNUB/pull/17). The test modules include:
test_gui.py
: Launches the GUI and loads a data-light example dataset with video, heatmap and trace plot. Currently this module does not include simulated GUI interactions.test_io.py
: Creates a new SNUB project and runs through a basic project-building workflow, including addition of a heatmap, scatter plot and video. The test passes if these steps complete without error. test_nwb.py
: Downloads an NWB file using the DANDI API and then converts the file into a SNUB dataset. The test passes if these steps complete without error. The test is essentially equivalent to the second example from the docs (https://github.com/calebweinreb/SNUB/blob/nwb/docs/source/nwb.rst)I ran the tests locally and measured a test coverage of 54% (using pytest-cov
). That's a great start!
I opened a separate issue #19 where I suggest separating the "dev" dependencies (e.g. pytest
), from the ones users require.
Ideally, you would want to run these tests across OS platforms and Python versions (e.g. using GitHub's CI features), but I'm fine with you adding those later.
I think this is a great start for testing, enough to at least check out basic functioning is someone wants to contribute to the project. Agreed that multiple platforms can come later, I'll close this for now!
The repo currently has no test modules, which is a major flow and would be highly recommended for deploying reliable and maintainable code.
Would you consider add testing modules to the codebase, and integrate a testing workflow using GitHub Actions?