You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/02/19 11:51:06 UTC

[GitHub] [solr] gerlowskija commented on a change in pull request #619: SOLR-11749 Several test changes

gerlowskija commented on a change in pull request #619:
URL: https://github.com/apache/solr/pull/619#discussion_r810480771



##########
File path: solr/packaging/test/test_start_solr.bats
##########
@@ -14,12 +15,19 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-function delete_all_collections() {
-  local collection_list="$(bin/solr zk ls /collections -z localhost:9983)"
-  for collection in $collection_list;
-  do
-    if [[ -n $collection ]]; then
-      bin/solr delete -c $collection
-    fi
-  done
+load bats_helper
+
+setup() {
+  common_setup
+}
+
+teardown() {
+  solr stop -all >/dev/null 2>&1
+}
+
+@test "SOLR11740 check f" {
+  run -0 solr start
+  run -0 solr start -p 7574
+  run bash -c 'solr stop -all 2>&1'
+  refute_output --partial 'forecfully killing'

Review comment:
       [Q] Is 'forecfully' a typo here, or a part of the test?

##########
File path: solr/packaging/test/README.md
##########
@@ -0,0 +1,57 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ -->
+
+# bin/solr Tests
+
+This directory contains tests for the `bin/solr` command-line scripts.
+
+All tests in this project use the [BATS](https://bats-core.readthedocs.io/en/stable/index.html) framework.
+
+## Running Tests
+
+Tests can be run via `./gradlew bats`.

Review comment:
       [-1] Should the task name here be `integrationTests`?  That's the task that works for me from the CLI, and the one that I see in `solr/packaging/build.gradle`

##########
File path: solr/packaging/test/README.md
##########
@@ -0,0 +1,57 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ -->
+
+# bin/solr Tests
+
+This directory contains tests for the `bin/solr` command-line scripts.
+
+All tests in this project use the [BATS](https://bats-core.readthedocs.io/en/stable/index.html) framework.
+
+## Running Tests
+
+Tests can be run via `./gradlew bats`.
+ This will download the necessary BATS libraries to your `.gradle` directory,
+ assemble the binary distribution, and run the full test suite.
+
+Individual test files can be run by specifying the `-P bats.tests=[test_file.bats]` property.
+
+## Writing Tests
+
+Our tests should all `load bats_helper` which provides a `common_setup` function that test files can
+call from their own `setup()` function.
+
+Test are defined as `@test "description of the test" { ... }`
+ with statements in the function body. Test names can include
+ letters, number, and spaces. They cannot include special
+ characters like dashes or underscores, so JIRA issue numbers
+ and command line flags are not valid test names. For more detail
+ about BATS features, please consult 
+ special features of BATS, please consult 
+
+Some tests will start clusters or create collections,
+ please take care to delete any resources that you create.
+ They will not be cleaned for you automatically.
+
+It is recommended that you install and run `shellcheck` to verify your test scripts and catch common mistakes before committing your changes.

Review comment:
       Neat!




-- 
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-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org