Union-izing test's extra_env_vars
and runtime_package_dependencies
#18775
Replies: 2 comments
-
My original thought was to move the 'collection' of the environment vars to a But:
|
Beta Was this translation helpful? Give feedback.
-
Sorry for not responding at the time! My initial thought on it is that if it is possible to build in the actual functionality that you want (launching and parenting services from Pants while a test is running), then that would be preferable to having a wrapper script start them, and then a Pants plugin to provide their settings. I’m having trouble finding a relevant issue, but it might look like a So, long story short: yes, I think that that type of |
Beta Was this translation helpful? Give feedback.
-
Background
I have a suite of tests that do integrations against an external environment. Currently our CICD will deploy the packaged dependencies to the system and then run the tests on the local machine. Which means our 'test' step is a bit more involved than just
./pants test ::
.One suggested solution to this was to create a codegen target that deploys the resources, but this would then cause things to be deployed unnecessarily every time
export-codegen
is run. It also doesn't solve how to inject the location of the deployed resources into the tests.idea
Currently you can define [test].extra_env_vars to inject extra stuff into the env, and runtime_package_dependencies to add packageable targets to the test process digest. But from a quick skim of the code, all of this is replicated in each backends subprocess call.
e.g.:
https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/python/goals/pytest_runner.py#L245
https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/go/goals/test.py#L595
It would be ideal if
extra_env_vars
andruntime_package_dependencies
were somehow Unionized. Allowing 3rd party plugins to provide ways to add additional data into test runs.Beta Was this translation helpful? Give feedback.
All reactions