-
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
[bug] not playing well with discovering unittests #239
Comments
@jan-janssen do you have any insight here? The solutions I see, in decreasing order of desirability, are:
But frankly even the best of those is not particularly nice. It's not clear to me how the insertion of |
@liamhuber I am in the same position, I am not aware of a way to transfer the classes. We could try to always pickle by value rather than by reference, but that is not as computationally efficient, so I do not want this as the default. Also changing the tests sounds annoying to me. Maybe somebody can take a look what kind of references |
@jan-janssen, ok thanks. It's nice that I've understood the situation at least 😂 I agree simply pickling everything by value is not the way to go and for the reasons you give. Filtering by unittest classes is an interesting idea. I worry it treats the symptom and not the cause, i.e. that there are other conditions where the code gets invoked from not- Github reusable workflows have explicit limitations around passing env variables from calling workflows to reusable workflows, but I'm confident we can find a workaround -- at least a boolean flag that triggers adding the stuff from inside the called workflow. IMO this is the least-worst solution, so I'll move in that direction. |
Currently all the unit tests use the paradigm
cd tests; python -m unittest discover .
, however a perfectly reasonable alternative ispython -m unittest discover tests
. However, the latter fails with error messages likeAs can be seen in #238 Unittests_by_path.
To the best of my understanding, this is a result of these lines in the backend:
https://github.com/pyiron/pympipool/blob/2c616aced49e8d513f3fd18aefda6f2d0d41f4e8/pympipool/backend/serial.py#L22-L26
Since in the latter case
"."
is the parent path from whichdiscover
is invoked, and not the path where the actual test files reside.This can be fixed by adding the test directory(ies) to the path (also demonstrated in #238 Unittests_by_path_with_env and Unittests_by_path_with_pythonpath which both run fine), but it still seems to me like something that should be fixed at the source rather than patched over in github workflows. In particular, I worry that if
unittest discover
has this sort of problem, other ways users invoke the executors might be similarly bugged.It's not clear to me whether or not there is a good solution to this problem.
Aside: the comment in the snippet above says this is necessary for flux, but if this is really the relevant line for this issue that would imply it is important for all the executors, or?
The text was updated successfully, but these errors were encountered: