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

Unit tests to verify functionality #32

Closed
rasbt opened this issue Apr 19, 2022 · 2 comments
Closed

Unit tests to verify functionality #32

rasbt opened this issue Apr 19, 2022 · 2 comments

Comments

@rasbt
Copy link

rasbt commented Apr 19, 2022

Sorry to push more things onto your todo list, but in the context of the JOSE review, it would be really helpful to have some basic unit tests in place.

Let me try to be reasonable and not ask for setting up automatic tests for the UI :). What I have in mind is basically "just" copying the examples and outputs you have in DeveloperDocumentation.ipynb into a unit test setup that works with pytest or nose.

Adding a CI service via a GitHub workflow would of course be great, but this is up to you. As a reviewer, it is sufficient for me to just run the code locally on my computer and knowing that the actual results match the expected results. In order to do that right now I would have to run the code in the DeveloperDocumentation.ipynb and check the results with my local results cell by cell. This is a bit tedious, to be honest. And also thinking about potential users who want to use the library and app locally, this would be tedious as well.

So, in the spirit of open source, there should be a unit test suite set up so that I just need to run a command like

pytest ./ADlib

I am really not expecting you to develop new unit tests. For me, just converting the examples you have in DeveloperDocumentation.ipynb would already be sufficient.

@lindseysbrown
Copy link
Owner

Hi @rasbt thank you for emphasizing the utility of testing for developers of the code (our main intention when writing was the use of the web app to complement classroom instruction - which the user wouldn't need to run tests for - perhaps we should have selected learning module instead of software submission...). In the initial development, we did have some unit tests written so we have added those back to the repo in addition to adding tests that explicitly match the examples in the documentation. Running pytest now works as you describe (and we have noted this option under installation in the documentation notebook).

@rasbt
Copy link
Author

rasbt commented May 14, 2022

Awesome, thanks. Just toyed with the unit tests via pytest and everything works.

Also, the small note you added should satisfy the "described" aspect in the reviewer checklist in my opinion :)

Tests: Are there automated tests or manual steps described so that the function of the software can be verified?

@rasbt rasbt closed this as completed May 14, 2022
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