avoid crash in test step of PyTorch easyblock if runtest is not a command#2883
Conversation
|
The changeset is huge and it is not exactly clear what is going on here. What is the use case? Why/when would How about changinging And maybe log a message instead of the "Test skipped" comment. But again: Why would you want that given that we have |
|
Because someone might get into their heads (like me) to set runtest = False which would then result in a crash... |
Then maybe add to the very top of the function a But I'd really use an early return here. Avoids all that indentation and complications |
|
Well runtest = True also crashes, but the |
True (no pun intended). Then maybe instead of logging "Tests skipped" we should simply throw an |
|
Wouldn't it be better to pick up on this as early as possible... i.e. at init time or so... |
Not sure if we really want to duplicate the logic. E.g. the super-test_step does some checking e.g. against |
|
Ok, makes sense. just tired of waiting for +30min of building before the code hits the problem :-) |
…ult instead of trying to avoid the problem explicitly.
|
@Flamefire something like this? |
Flamefire
left a comment
There was a problem hiding this comment.
Yes almost. I'd invert the condition though such that the "False" message is correct and the other a best guess.
| if self.cfg['runtest'] or self.cfg['runtest'] is None: | ||
| msg = "runtest must be set to a command to run." | ||
| else: | ||
| msg = "Do not set runtest to False, use --skip-test-step instead." |
There was a problem hiding this comment.
| if self.cfg['runtest'] or self.cfg['runtest'] is None: | |
| msg = "runtest must be set to a command to run." | |
| else: | |
| msg = "Do not set runtest to False, use --skip-test-step instead." | |
| if self.cfg['runtest'] is False: | |
| msg = "Do not set runtest to False, use --skip-test-step instead." | |
| else: | |
| msg = "Tests did not run. Make sure `runtest` is set to a command." |
There was a problem hiding this comment.
changed it around now.
|
Test report by @boegel Overview of tested easyconfigs (in order)
Build succeeded for 0 out of 1 (1 easyconfigs in total) |
|
The fact that some PyTorch tests (still) fail is irrelevant to the changes in this PR, so I'll go ahead and merge this... |
(created using
eb --new-pr)