purple-plastic-57801
08/22/2023, 10:39 PMhappy-kitchen-89482
08/23/2023, 3:44 AMhappy-kitchen-89482
08/23/2023, 3:44 AMacoustic-library-86413
08/23/2023, 7:01 AMPANTS_EXECUTION_SLOT works well for configuration that can happen outside a Docker container, e.g. testing FastAPI clients using the TestClient and such.
However, from what I've been able to tell there is no way to change the environment variables of a running container without restarting it due to how processes work in Linux. This makes it difficult to test code that relies on talking to some container which then e.g. talks to a database.
Since we can't update the configuration to account for the value of PANTS_EXECUTION_SLOT without restarting we're more or less forced to spin up a separate database for these tests alone?
Has anyone found a way around this, short of creating a separate protected API endpoint that modifies some configuration file in-place which is read before every request, or something to that effect.purple-plastic-57801
08/24/2023, 12:38 AMWhen you say "each test spins up its own test container", is that happening inside pytest?@happy-kitchen-89482 apologies for the delay. This is correct. We either start per test or per module. Would you be able to explain the execution slot ?
purple-plastic-57801
08/24/2023, 12:39 AM