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

Add unit tests for recipe functions #173

Closed
rabernat opened this issue Jul 21, 2021 · 3 comments
Closed

Add unit tests for recipe functions #173

rabernat opened this issue Jul 21, 2021 · 3 comments

Comments

@rabernat
Copy link
Contributor

As discussed in #171 (comment), the recent refactoring of the XarrayZarrRecipe class has made it more modular, in the sense that most of the key functions can be run without instantiating a big Recipe class and executing the whole recipe. This means we can have unit tests for all of these individual functions to verify that they do exactly what is expected of them. This would complement the more holistic integration-style tests we currently have for XarrayZarrRecipe. It might also provide a path for reducing our test suite cost while maintaining high coverage. (It currently takes > 10 minutes to run all the tests.)

@cisaacstern
Copy link
Member

Just noting that I'm very interested in expanding my testing knowledge/competency by working on this. If anyone else gets started on it before I do, please ping me as I'd love to help out with it.

@rabernat
Copy link
Contributor Author

Now that #219 has been merged, it should be much easier to implement unit tests. This is because all of the "work" of the recipe now happens in standalone functions, e.g.

prepare_target(config=recipe)

We should revisit this issue now. To begin, I would recommend that we just start a new testing folder (e.g. recipe_unit_tests) and rename the existing one to recipe_integration_tests, which is basically what they are. The unit tests would not attempt to do end-to-end runs of recipes but would rather examine each function in isolation in a very controlled way. We could develop new fixtures so these new tests are very fast and compact.

@cisaacstern
Copy link
Member

The functions discussed here are all superseded as of 0.10.0 release, so closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants