fast-nail-55400
02/14/2025, 9:14 PMexperimental_test_shell_command
? Is there anything you would consider essential to implement or fix for stabilizing it as just test_shell_command
?dazzling-pizza-75442
02/19/2025, 7:49 PMtools
attribute on experimental_test_shell_command
vs. runnable_dependencies
- why aren't they the same attribute? The former takes the name of binaries whereas the latter takes addresses to system_binaries
. (there are some other inconsistencies, like path_env_modify
that can be confusing).
2. It would be helpful to easily capture the output of tests (e.g. if your command outputs logs or coverage... or in our case screenshots from cypress tests).fast-nail-55400
02/19/2025, 7:56 PMtools
attribute on experimental_test_shell_command
vs. runnable_dependencies
- why aren't they the same attribute? The former takes the name of binaries whereas the latter takes addresses to system_binaries
. (there are some other inconsistencies, like path_env_modify
that can be confusing).
The shell backend treats tools
and runnable_dependencies
fields as distinct entities. I just never added runnable_dependencies
to the experimental_test_shell_command
target type. (And finding out points like that is part of why I'm asking the stabilization question.) As for why both exist, not sure, probably just written at different times.
Side note: path_env_modify
exists mainly for the in-workspace execution support when downstream tools (like Bazel) incorporate PATH
into their own cache key. In those cases, an always-changing PATH
means the downstream tool may never cache results since the tool's cache key changes for every Pants invocation.fast-nail-55400
02/19/2025, 8:00 PM2. It would be helpful to easily capture the output of tests (e.g. if your command outputs logs or coverage... or in our case screenshots from cypress tests).I agree. That wasn't an initial use case when I first wrote the proof of concept for
experimental_test_shell_command
, but sounds immensely useful. (It should be easy enough to implement as well since the shell backend rules use the same helper to setup both shell_command
and experimental_test_shell_command
executions so I just need to add the fields. It may need a little work to make sure the results can be used with other targets.)fast-nail-55400
02/19/2025, 8:01 PMexperimental_test_shell_command
just be folded into shell_command
then? I.e.., make shell_command
targets runnable as tests via some sort of test_goal=True
field (with a better name of course)?fast-nail-55400
02/19/2025, 8:08 PMexperimental_test_shell_command
exists as a target type because it fits the pattern established by run_shell_command
being the way to integrate with the run
goal.fast-nail-55400
02/19/2025, 8:24 PMexperimental_test_shell_command
execution.fast-nail-55400
02/19/2025, 8:38 PMfast-nail-55400
02/19/2025, 8:40 PMdazzling-pizza-75442
02/19/2025, 9:54 PMdazzling-pizza-75442
02/19/2025, 10:25 PMexperimental_test_shell_command
. I was trying to do something like:
cp -r {chroot}/path/to/cypress/screenshots cypress/screenshots
as part of the cmd
, but it doesn't look like {chroot}
or $CHROOT
are being populated. Is that a documentation bug or should it work? We do something similar in a run_shell_command
where it does work (and maybe I should be using the local environment feature instead? but that's a bigger change because I'm setting up all the node stuff inside of the pants sandbox).
I can move these comments into the gh issue instead, too 🙂fast-nail-55400
02/19/2025, 11:10 PMfast-nail-55400
02/19/2025, 11:10 PMexperimental_test_shell_command
runs in the execution sandbox so the current directory is not the repository.fast-nail-55400
02/19/2025, 11:11 PMtest
goal already supports capture and materializing the captured outputs, assuming you are satisfied with that support.