pytest-dev / pytest-xdist

pytest plugin for distributed testing and loop-on-failures testing modes.
https://pytest-xdist.readthedocs.io
MIT License
1.49k stars 232 forks source link

Make node ID modification more stable. #1118

Open criemen opened 2 months ago

criemen commented 2 months ago

We force test collection on the controller node, as we run some global setup there before starting the workers. That setup also depends on the test node IDs, but currently, pytest-xdist only modifies the test node IDs on the workers, that've been started and where setup_config has been called. I don't see a good reason for this, and for creating a separate config entry, so let's just check the right condition in the pytest hook. That way, the hook will always do the same node ID transformation, regardless of pytest-xdist setup.

Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs:

RonnyPfannschmidt commented 2 months ago

Node id modification needs to be dropped all together

criemen commented 2 months ago

That is a good point - as all the unit tests fail on this PR anyways, I'll see what I can do.

RonnyPfannschmidt commented 2 months ago

Doing the stuff the hack with node id enabled in a more natural way is a major undertaking

Only got there as a follow-up

criemen commented 2 months ago

I'll collect feedback on https://github.com/pytest-dev/pytest-xdist/pull/1119 and if that's not a viable route, I'll try to resurrect this PR instead.