Happy Friday to everyone! My question today is: wh...
# general
m
Happy Friday to everyone! My question today is: what are people's workarounds given debugger / interactive mode cannot be used when running Docker tests with Pants? The relevant open issue does not mention any approach at the moment. Are folks basically using a snippet to run Docker container with interactive mode directly, then run
pants test
inside the container? While that would be ok for cases of only having one desired Docker environment for tests, in a monorepo where different environments are desired it procludes the heterogeneous environment benefits provided by Pants. TIA
h
I’m not sure what work would need to be done to run InteractiveProcesses in an environment, but I’m not sure how this relates to tests? I believe that tests run in a non-interactive process (unless you’re attaching a debugger, is that what you’re trying to do?)
m
Attaching a debugger yes 👍 Apologies that wasn't clear - updated the initial message! My concern is that if having to run Pants tests manually inside a Docker container, that we lose all the benefits of being able to run tests in different Docker environments/images.
h
Aha! Yeah, maybe @bitter-ability-32190 and @witty-crayon-22786 have insights?
🙌 1
b
I have to imagine it's doable, but it's been at least a year since I've thought about it. You'd have to dive into pydevd at the very least
h
Is there a workaround we had in mind at the time?
b
I never did docker dev, so I couldn't say I had anything in that realm in mind. You might poke at how vs code does it with Dev containers. I'm sure there's TONS of overlap there
m
fwiw I'll just mention my current plan - in case I'm missing another obvious option - for allowing the use of debugger in tests: 1. build a Docker image that contains OS dependencies for all different projects in my monorepo 2. install & run Pants tests inside that Docker image using "local environment" mode, with this mounting approach to hopefully still get the caching benefits