janhoy commented on code in PR #2710: URL: https://github.com/apache/solr/pull/2710#discussion_r1759754331
########## solr/core/src/java/org/apache/solr/cli/HealthcheckTool.java: ########## @@ -170,7 +172,15 @@ protected void runCloudTool(CloudSolrClient cloudSolrClient, CommandLine cli) th q = new SolrQuery("*:*"); q.setRows(0); q.set(DISTRIB, "false"); - try (var solrClientForCollection = SolrCLI.getSolrClient(coreUrl)) { + + // SolrCLI.getSolrClient converts the coreUrl back into a root Solr url, but we need to + // talk to specific core so manually creating the client. Review Comment: Hmm, would you say this is a bug, or is it well documented in the javadoc? ########## solr/packaging/test/test_healthcheck.bats: ########## @@ -29,8 +29,9 @@ teardown() { } @test "healthcheck on cloud solr" { - solr start -c -e films - run solr healthcheck -c films + solr start -c -e films -p ${SOLR_PORT} + run solr healthcheck -c films -zkhost localhost:${ZK_PORT} -V refute_output --partial 'error' Review Comment: Did you say that the refute should be case insensitive? Is that even supported in BATS? ########## solr/core/src/java/org/apache/solr/cli/ToolBase.java: ########## @@ -34,18 +34,29 @@ protected ToolBase(PrintStream stdout) { } protected void echoIfVerbose(final String msg, CommandLine cli) { - if (cli.hasOption(SolrCLI.OPTION_VERBOSE.getOpt())) { + if (verbose) { echo(msg); } } + /** + * Is this tool being run in a verbose mode? + * + * @return verbose or not Review Comment: Unnecessary `@return` doc as the method name clearly indicates what is returned? :) ########## solr/packaging/test/test_delete_collection.bats: ########## @@ -77,3 +77,15 @@ teardown() { solr delete -c "COLL_NAME" --delete-config false assert config_exists "COLL_NAME" } + +@test "ensure -p port parameter is supported" { + + #solr start -c -p ${SOLR2_PORT} + #solr assert --started http://localhost:${SOLR2_PORT} --timeout 5000 Review Comment: Remove dead code ########## solr/packaging/test/test_create.bats: ########## @@ -34,8 +34,31 @@ teardown() { assert_output --partial "Created new core 'COLL_NAME'" } +@test "create_core works" { + run solr start + run solr create_core -c COLL_NAME + assert_output --partial "Created new core 'COLL_NAME'" +} + @test "create for cloud mode" { run solr start -c run solr create -c COLL_NAME assert_output --partial "Created collection 'COLL_NAME'" } + +@test "ensure -p port parameter is supported" { + solr start -p ${SOLR2_PORT} + solr assert --not-started http://localhost:${SOLR_PORT} --timeout 5000 + solr assert --started http://localhost:${SOLR2_PORT} --timeout 5000 + + run solr create -c COLL_NAME -p ${SOLR2_PORT} + assert_output --partial "Created new core 'COLL_NAME'" +} + +@test "ensure -V verbose parameter is supported" { + solr start + solr assert --started http://localhost:${SOLR_PORT} --timeout 5000 + + run solr create -c COLL_NAME -V + assert_output --partial "Created new core 'COLL_NAME'" Review Comment: Should not this assert a string that is only printed in verbose mode? -- 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: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org