pytest-dev / pytest-dev/pytest-xdist

Question: How could one customize the distributed worker initialization (e.g. running some bash commands on setup)?

Open
#871 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.9k
Forks
287
Avg merge
9h 30m
Merged PRs (30d)
2

Description

Hello there!

I'm still in the process of familiarizing myself with the codebase, sorry if the answer to this is already documented somewhere.
From what I've understood, you're using execnet gateways and channels to execute python code on the remote hosts, and you make these different parts inspectable and usable with pytest hooks.

I haven't been able to find a way to specify a set of commands I'd like to run "on remote worker spawn". Is there a way of doing this?
For example, I'd like the remote worker to first activate a given Conda environment before running any tests.

Thanks a lot!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the execnet gateway and channel setup for remote worker spawning, then review the pytest hooks mentioned in the issue. Determine whether an existing hook or configuration point can run commands before tests, and define completion as a documented way to prepare each remote worker, such as activating a Conda environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
distributed-systems, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.