-
Notifications
You must be signed in to change notification settings - Fork 3
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 are manual, not unit test? #130
Comments
Thanks for the comments! We will get to this ASAP. The second author @MrGafaji has a busy week this week, but we plan to work on it this weekend. We will keep you updated on this issue! |
Thanks for the wait! We have made all the tests automated as per the JOSS checklist. Also, tests such as the test_Bessel.py now do what they were supposed to do. The correct packaging of PyPO should have gotten rid of this particular code smell. The instructions for running the testsuite can be found in the docs. |
Thank you for the updates. A pain point, the documentation suggests: I ran the tests on my M2 macbook air for more than ten minutes, and ctrl+C'd them after waiting that long. It looks like TestBessel has a dead spin or something in it,
The other tests took just a few moments to run up to then. Could you check if the bessel unit tests are just some arm64 / big endian bug or something? |
Thank you for the response. We have updated the way tests are run. We have actually overhauled and streamlined the tests quite a bit. They now use the parametrisation capabilities of nose2 more fully and therefore the total amount of test code has gone down. This dependency on the arametrisation of nose2 does mean that they must be run like:
Also, the tests are not run anymore from the DevUtils.py script. We have updated the instructions in the docs accordingly. On a different note, the test (Bessel) that took so long was actually taking long. I had put the gridsizes of one optical element quite high, in order to test some scaling stuff with my GPU and forgot to put it back I'm afraid. It did not need to be that high. In this way, we still have these demonstrations, which are more like (physical) validations, but have them separated from the unit tests. Could you please check the unit tests again and confirm if they work? |
thanks! They all pass with a |
This issue is part of my portion of the JOSS review, openjournals/joss-reviews#5478
Browsing a random unit test,
test_Bessel.py
, as best I can tell the test does not do what it says:The last line of the comment -- the comparison, seems to happen but not in a quantified way. It looks like the assertion just tests whether the values are truth (not zero, NaN, inf, or -inf) - https://github.com/PyPO-dev/PyPO/blob/main/tests/test_Bessel.py#L33-L39
The plotting code seems to imply this is a test that a human runs, looks at a plot, and makes a decision on? That is a manual validation test, not a unit test
I looked at a couple of other tests, e.g. fit gauss, and some of them are truly unit tests. Please make all of the unit tests unit tests, and separate out the manual tests.
The tests also have a bad code smell,
You should never see this in python code, it should be
from PyPO.System import System
; thesrc.
means this can only be done with cwd at the root of the repo, and implies an improperly installed package (related to #128)The text was updated successfully, but these errors were encountered: