You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "epugh (via GitHub)" <gi...@apache.org> on 2023/04/30 14:46:22 UTC

[GitHub] [solr] epugh opened a new pull request, #1601: SOLR-12226: Basic zk test framework in BATS

epugh opened a new pull request, #1601:
URL: https://github.com/apache/solr/pull/1601

   https://issues.apache.org/jira/browse/SOLR-12226
   
   
   # Description
   
   Start testing ZK interaction as we get into cli changes..
   
   # Solution
   
   basic bats test to see if it works
   
   # Tests
   literally wrote a test ;-)
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [ ] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [ ] I have created a Jira issue and added the issue ID to my pull request title.
   - [ ] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [ ] I have developed this patch against the `main` branch.
   - [ ] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   - [ ] I have added documentation for the [Reference Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
   


-- 
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


[GitHub] [solr] epugh commented on pull request #1601: SOLR-12226: Basic zk test framework in BATS

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on PR #1601:
URL: https://github.com/apache/solr/pull/1601#issuecomment-1529046779

   I have a start here...   Including uncovering an interesting `bin/solr cp` command that looks aliased somehow, but not the same, to `bin/solr zk cp`


-- 
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


[GitHub] [solr] epugh merged pull request #1601: SOLR-12226: Basic zk test framework in BATS

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh merged PR #1601:
URL: https://github.com/apache/solr/pull/1601


-- 
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


[GitHub] [solr] epugh commented on a diff in pull request #1601: SOLR-12226: Basic zk test framework in BATS

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on code in PR #1601:
URL: https://github.com/apache/solr/pull/1601#discussion_r1181820164


##########
solr/packaging/test/test_zk.bats:
##########
@@ -0,0 +1,77 @@
+#!/usr/bin/env bats
+
+# 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.
+
+load bats_helper
+
+setup_file() {
+  common_clean_setup
+  solr start -c
+}
+
+teardown_file() {
+  common_setup
+  solr stop -all
+}
+
+setup() {
+  common_setup
+}
+
+teardown() {
+  # save a snapshot of SOLR_HOME for failed tests
+  save_home_on_failure
+}
+
+@test "listing out files" {
+  sleep 1
+  run solr zk ls / -z localhost:9983
+  assert_output --partial "aliases.json"
+}
+
+@test "copying files around" {
+  touch myfile.txt
+  # Umm, what is solr cp?  It's like bin/solr zk cp but not?
+  run solr cp -src myfile.txt -dst zk:/myfile.txt -z localhost:9983
+  assert_output --partial "Copying from 'myfile.txt' to 'zk:/myfile.txt'. ZooKeeper at localhost:9983"
+  sleep 1
+  run solr zk ls / -z localhost:9983
+  assert_output --partial "myfile.txt"
+
+  touch myfile2.txt
+  run solr zk cp myfile2.txt zk:myfile2.txt -z localhost:9983
+  assert_output --partial "Copying from 'myfile2.txt' to 'zk:myfile2.txt'. ZooKeeper at localhost:9983"
+  sleep 1
+  run solr zk ls / -z localhost:9983
+  assert_output --partial "myfile2.txt"
+
+  rm myfile.txt
+  rm myfile2.txt
+}
+
+@test "upconfig" {
+  local source_configset_dir="${SOLR_TIP}/server/solr/configsets/sample_techproducts_configs"
+  test -d $source_configset_dir
+
+  run solr zk zk upconfig -d ${source_configset_dir} -n techproducts2 -z localhost:9983

Review Comment:
   It's like doublemint gum...   it's twice the fun!



-- 
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


[GitHub] [solr] risdenk commented on a diff in pull request #1601: SOLR-12226: Basic zk test framework in BATS

Posted by "risdenk (via GitHub)" <gi...@apache.org>.
risdenk commented on code in PR #1601:
URL: https://github.com/apache/solr/pull/1601#discussion_r1181723770


##########
solr/packaging/test/test_zk.bats:
##########
@@ -0,0 +1,77 @@
+#!/usr/bin/env bats
+
+# 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.
+
+load bats_helper
+
+setup_file() {
+  common_clean_setup
+  solr start -c
+}
+
+teardown_file() {
+  common_setup
+  solr stop -all
+}
+
+setup() {
+  common_setup
+}
+
+teardown() {
+  # save a snapshot of SOLR_HOME for failed tests
+  save_home_on_failure
+}
+
+@test "listing out files" {
+  sleep 1
+  run solr zk ls / -z localhost:9983
+  assert_output --partial "aliases.json"
+}
+
+@test "copying files around" {
+  touch myfile.txt
+  # Umm, what is solr cp?  It's like bin/solr zk cp but not?
+  run solr cp -src myfile.txt -dst zk:/myfile.txt -z localhost:9983
+  assert_output --partial "Copying from 'myfile.txt' to 'zk:/myfile.txt'. ZooKeeper at localhost:9983"
+  sleep 1
+  run solr zk ls / -z localhost:9983
+  assert_output --partial "myfile.txt"
+
+  touch myfile2.txt
+  run solr zk cp myfile2.txt zk:myfile2.txt -z localhost:9983
+  assert_output --partial "Copying from 'myfile2.txt' to 'zk:myfile2.txt'. ZooKeeper at localhost:9983"
+  sleep 1
+  run solr zk ls / -z localhost:9983
+  assert_output --partial "myfile2.txt"
+
+  rm myfile.txt
+  rm myfile2.txt
+}
+
+@test "upconfig" {
+  local source_configset_dir="${SOLR_TIP}/server/solr/configsets/sample_techproducts_configs"
+  test -d $source_configset_dir
+
+  run solr zk zk upconfig -d ${source_configset_dir} -n techproducts2 -z localhost:9983

Review Comment:
   `solr zk zk` - double zk?



##########
solr/packaging/test/test_zk.bats:
##########
@@ -0,0 +1,77 @@
+#!/usr/bin/env bats
+
+# 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.
+
+load bats_helper
+
+setup_file() {
+  common_clean_setup
+  solr start -c
+}
+
+teardown_file() {
+  common_setup
+  solr stop -all
+}
+
+setup() {
+  common_setup
+}
+
+teardown() {
+  # save a snapshot of SOLR_HOME for failed tests
+  save_home_on_failure
+}
+
+@test "listing out files" {
+  sleep 1
+  run solr zk ls / -z localhost:9983
+  assert_output --partial "aliases.json"
+}
+
+@test "copying files around" {
+  touch myfile.txt
+  # Umm, what is solr cp?  It's like bin/solr zk cp but not?
+  run solr cp -src myfile.txt -dst zk:/myfile.txt -z localhost:9983

Review Comment:
   I thought one came (cp or zk cp) first and then one was going to be removed but I don't remember anymore.



-- 
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


[GitHub] [solr] epugh commented on pull request #1601: SOLR-12226: Basic zk test framework in BATS

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on PR #1601:
URL: https://github.com/apache/solr/pull/1601#issuecomment-1529057627

   Okay, I've got upconfig and ls in here...   I think this is ready for review..  if there are some specific scearnious that you think need adding, please holler.


-- 
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


[GitHub] [solr] epugh commented on a diff in pull request #1601: SOLR-12226: Basic zk test framework in BATS

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on code in PR #1601:
URL: https://github.com/apache/solr/pull/1601#discussion_r1181871105


##########
solr/packaging/test/test_zk.bats:
##########
@@ -0,0 +1,77 @@
+#!/usr/bin/env bats
+
+# 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.
+
+load bats_helper
+
+setup_file() {
+  common_clean_setup
+  solr start -c
+}
+
+teardown_file() {
+  common_setup
+  solr stop -all
+}
+
+setup() {
+  common_setup
+}
+
+teardown() {
+  # save a snapshot of SOLR_HOME for failed tests
+  save_home_on_failure
+}
+
+@test "listing out files" {
+  sleep 1
+  run solr zk ls / -z localhost:9983
+  assert_output --partial "aliases.json"
+}
+
+@test "copying files around" {
+  touch myfile.txt
+  # Umm, what is solr cp?  It's like bin/solr zk cp but not?
+  run solr cp -src myfile.txt -dst zk:/myfile.txt -z localhost:9983

Review Comment:
   I have added https://issues.apache.org/jira/browse/SOLR-16780 to track this.



-- 
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