-
Notifications
You must be signed in to change notification settings - Fork 234
Exit code consolidation #663
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
Comments
the code in the stackoverflow is incorrect the skip will happen instantly as this in turn will destroy test collection and get you exit code 5 as its not clear what you do with your workers, applying skip in some of them is absolutely wrong please describe the actual desired behaviour |
Thank you for the quick response! Per pytest run, I can't know in advance how many workers I need. We have a configuration that is generated dynamically and determines that. So I only find out whether I need the worker or not once I'm already inside it (specifically, I need information from Because of that, I want to somehow stop/disable/ignore the worker from In summation - The desired behavior is to be able to make a worker stop running from inside the |
The structure you envision is not supportable in xdist, you need to decide on the control process, for the workers it's too late |
Hi @RonnyPfannschmidt |
@cr-idanhaim your use-case is not clear to me, the problem is that the process that will set the unless i have a better idea of what you actually do i cant give any sensible solution right now there are no hooks you can use, the thing you want to do is simply not working in xdist as it is now |
Thanks @RonnyPfannschmidt for the quick response. |
can you elaborate how you determine the number of vm's ? im under the impression this could be done differently also if you run all tests against vm's - how do you determine the vm's? |
We have a class CiConfig():
def __init__(self):
self.machines = dict()
self.machines['endpoint'] = [VM(ip='1.1.1.1'), VM(ip='2.2.2.2')] In |
You can just use that to populate something for invoking pytest itself Then you can have a try first configure hook and just set - n as required |
Do you mean to wrap the pytest command with a script retrieving the number of VM's? If so, do we need to use |
Depending on the setup, it's potentially OK to just do it in pytest_configure |
We don't know in advance how many workers we need for the tests (it depends on information we calculate in
pytest_generate_tests
), so if we have too many workers, we skip the redundant ones (as suggested here - https://stackoverflow.com/questions/33400071/skip-parametrized-tests-generated-by-pytest-generate-tests-at-module-level) and it worksProblem now is the exit code. For some reason, if I have some workers which returns exitstatus 0 (OK), and some workers which returns exitstatus 5 (NO_TESTS_COLLECTED), the general return code from the pytest run (from master) is 5 (where I want it to be 0, because all of the collected tests passed).
Is that a bug or the desired behavior? And if it's the latter, any ideas to how can I accomplish the behavior I want?
The text was updated successfully, but these errors were encountered: