quaint-telephone-89068
12/20/2022, 9:11 PMtest-plus goal which does the setup/teardown before running the normal test rules, it has the following shortfalls:
• Copy-Pasted from the canonical implementation.
• Non-Standard. Have to remember to run ./pants test-plus instead of `./pants test
• Built for a single task. (Admittedly, I could probably merge my implementations with some tactical Unions)
• No mechanism for feeding additional information into the test.
* alternatives considered*
• Doing all this in the test framework
• Pants-plugin is doing it already, would be duplicate effort
• Defining a X_on_Y target and specifying runtime_dependencies.
• This had the problem that ./pants package would deploy the target (undesired)
• Adding Pre/Post goal hooks.
• my implementation was cumbersome.
• required every goal to add call the pre-goal and post-goal rules.
• Didn't necessarily make sense for every goal (i.e. micro-controller tests needed the device tty, what if you have multiple devices or targets?)
• Why stop at goal? Why not add middleware to rules?
Possibly another solution could be to have some sort of TestContextRequest -> TestContext rule that would return a digest and environment map.
pantsbuild/pants