I'm working on learning more about pants so my que...
# general
b
I'm working on learning more about pants so my questions will still be rough. At pants package/runtime, I want to copy over a python based integration test into a lot of subfolders and have them run it. Is there a way to accomplish that or something similar through the pants targets? The idea is to be able to put a target/macro in a subfolders build and have that subfolder picked up for integration tests. I want something similar to
experimental_wrap_as_python_sources
but for python_test. I did try writing a plugin to make use the underlying logic used by most
experimental-wrap_as_{name}
stuff, but that doesn't get picked up unless I include the
PythonTestSourceField
which breaks it.
b
Sorry if this is an unhelpful suggestion but I wonder if it's possible for you to do this with code reuse instead -- like instead of having a build target refer to the same source code in multiple packages, you have an actual python entry point in each package, and they run the common integration test code just by importing and invoking a function -- they can be like 2-line scripts, and automatically included in
python_tests
rules.
b
Good catch. That's how it is currently. I'm wanting to avoid having to put a python file in all the folders. It's a bit overkill to do, but it's an interesting application that I want to try to solve.
👍🏾 1
My current exploration path is making a lazy_python_test that doesn't do any checks on the source file and just assumes it'll be present at runtime. But I'm still learning a lot about building plug-ins. I'm mostly just overriding fields and seeing what happens.