janhoy commented on code in PR #5337:
URL: https://github.com/apache/solr/pull/5337#discussion_r4642550227


##########
solr/packaging/test/test_help.bats:
##########
@@ -22,16 +22,47 @@ setup() {
 }
 
 @test "solr help flag prints help" {
-  run -1 solr --help
-  assert_output_for_cli 'Usage: solr COMMAND OPTIONS' 'usage: bin/solr'
-  refute_output --partial 'ERROR'
+  for flag in --help -h; do
+    run -0 solr "$flag"
+    assert_output_for_cli 'Usage: solr COMMAND OPTIONS' 'usage: bin/solr'
+    refute_output --partial 'ERROR'
+  done
 }
 @test "solr with no flags prints help" {
-  run -1 solr
+  run -2 solr
   assert_output_for_cli 'Usage: solr COMMAND OPTIONS' 'usage: bin/solr'
   refute_output --partial 'ERROR'
 }
 
+check_parent_help() {
+  local parent=$1 commons_marker=$2 picocli_marker=$3
+  run -2 solr "$parent"
+  assert_output_for_cli "$commons_marker" "$picocli_marker"
+  refute_output --partial 'ERROR'
+  for flag in --help -h; do
+    run -0 solr "$parent" "$flag"
+    assert_output_for_cli "$commons_marker" "$picocli_marker"
+    refute_output --partial 'ERROR'
+  done
+}
+
+@test "zk requires a subcommand" {

Review Comment:
   🤖 This PR changes `test_help.bats`: new exit-code expectations for `--help`, 
`-h` and a bare `solr`, plus tests for `zk`/`snapshot`/`package` requiring a 
subcommand and for a JVM startup failure being propagated. BATS is going away: 
CATS (SOLR-18642, #5323) has replaced it on `main`, and SOLR-18645 (#5369) 
removes the `.bats` files. Please port these to `HelpTest` in 
`solr/packaging/src/test/org/apache/solr/shell/`, including the changed exit 
codes in its existing cases. See 
[dev-docs/cats.adoc](https://github.com/apache/solr/blob/main/dev-docs/cats.adoc)
 for porting help.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to