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

How Master node can know info from Worker nodes after call pytest_collection_modifyitems? #1004

Open
voloxastik opened this issue Jan 10, 2024 · 8 comments

Comments

@voloxastik
Copy link

voloxastik commented Jan 10, 2024

Hello everyone!
I am using Terstrail plugin to report.
So I need to know the list of test cases collected when calling pytest_collection_modifyitems on each node.
Do you know how I can know this?
Thanks.

@RonnyPfannschmidt
Copy link
Member

Xdist only sends the nodes to the coordinator after modifyitems

Would the collection Reports come in handy

@voloxastik
Copy link
Author

pytest_collection_modifyitems have workeroutput, but I not see in them in hook pytest_xdist_node_collection_finished

@voloxastik
Copy link
Author

Xdist only sends the nodes to the coordinator after modifyitems

Would the collection Reports come in handy

could you explain more about what report you mean?

@RonnyPfannschmidt
Copy link
Member

i did mean the collection reports, however i just took note, that those will not serialize the node details over the wire

without more details on your use-case i cant give a meaningfull answer

@voloxastik
Copy link
Author

voloxastik commented Jan 10, 2024

I need a list of testrail cases that was generated when pytest_collection_modifyitems was executed. After that I need to get this information from all nodes. and create a test run in testrail before push result

@nicoddemus
Copy link
Member

I need a list of testrail cases that was generated when pytest_collection_modifyitems was executed. After that I need to get this information from all nodes. and create a test run in testrail before push result

You should be able to use a hookwrapper for that.

@voloxastik
Copy link
Author

@nicoddemus
The question is not about writing a handler, but how to get the data after running the hook pytest_collection_modifyitems on each node to the master and execute something on the master after that and before running the tests.

@nicoddemus
Copy link
Member

nicoddemus commented Jan 11, 2024

See pytest_xdist_node_collection_finished, I think you might be able to keep the nodeids for each work around, and then do something later once the collection finishes.

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

3 participants