cool-easter-32542
04/20/2023, 9:07 PM./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 and runtime_package_dependencies were somehow Unionized. Allowing 3rd party plugins to provide ways to add additional data into test runs.
pantsbuild/pants