-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shell: add experimental_test_shell_command
for arbitrary shell-driven tests
#17640
Conversation
Example from pants-go-testing: tdyas/pants-go-testing@64a0d49 |
9cc7c4e
to
679b5a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super-neat! Not to bikeshed, but I had a suggestion re name.
I'll also let @chrisjrn weigh in, since he's been looking at some of this.
@@ -393,6 +403,42 @@ class ShellCommandRunTarget(Target): | |||
) | |||
|
|||
|
|||
class ShellCommandTestTarget(Target): | |||
alias = "experimental_test_shell_command" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is a bit of a mouthful. I'm wondering about naming it experimental_generic_test
? The "shell" name here (and in experimental_shell_command
) is a bit misleading, since this can run arbitrary processes, it's not limited to just shell constructs. And it's also easily confused with "tests shell code".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a particular care as to what the name is. Please feel free to just tell me what the name should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also if called generic_test
, should it be in a separate generic
backend instead of the shell
backend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can leave as-is for now, since we have to rename experimental_shell_command
anyway before we de-experimentalize it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I've no strong opinions on naming this either..
Perhaps the _command
suffix could do without, so experimental_test_shell
?
I also like the generic_test
bit 🤷🏽
Add an
experimental_test_shell_command
target type to enable defining arbitrary tests using shell code.Note: This target is not a unit test of shell sources like
shunit2_tests
; rather, it is a test defined in shell which could test anything which can be packaged and consumed by the other shell targets (e.g.,experimental_shell_command
andexperimental_run_shell_command
). It is basicallyexperimental_run_shell_command
but for thetest
goal instead of therun
goal.