adoroszlai commented on a change in pull request #1263:
URL: https://github.com/apache/hadoop-ozone/pull/1263#discussion_r462307855



##########
File path: hadoop-ozone/dist/src/main/compose/ozone-topology/test.sh
##########
@@ -39,7 +39,7 @@ execute_robot_test scm topology/loaddata.robot
 
 stop_containers datanode_1 datanode_2 datanode_3
 
-execute_robot_test scm topology/readdata.robot
+execute_robot_test scm topology/readdata.robot -N readdata-first-half

Review comment:
       Arguments need to be swapped:
   
   ```suggestion
   execute_robot_test scm -N readdata-first-half topology/readdata.robot
   ```
   
   to avoid:
   
   ```
   2020-07-29T09:51:30.5630160Z [ ERROR ] Parsing 'topology/readdata.robot' 
failed: File or directory to execute does not exist.
   ```

##########
File path: hadoop-ozone/dist/src/test/shell/compose_testlib.bats
##########
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# 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.
+
+
+source ../../main/compose/testlib.sh

Review comment:
       This needs to be updated to avoid failure in _bats_ check:
   
   ```suggestion
   load ../../main/compose/testlib.sh
   ```

##########
File path: hadoop-ozone/dist/src/main/compose/test-all.sh
##########
@@ -64,10 +49,16 @@ for t in ${tests}; do
       RESULT=1
       echo "ERROR: Test execution of ${d} is FAILED!!!!"
   fi
+  cd "$SCRIPT_DIR"
   RESULT_DIR="${d}/result"
-  cp "$RESULT_DIR"/robot-*.xml "$RESULT_DIR"/docker-*.log "$RESULT_DIR"/*.out* 
"$ALL_RESULT_DIR"/
+  TEST_DIR_NAME=$(basename ${d})
+  rebot -N $TEST_DIR_NAME -o "$ALL_RESULT_DIR"/$TEST_DIR_NAME.xml 
"$RESULT_DIR"/"*.xml"
+  cp "$RESULT_DIR"/docker-*.log "$ALL_RESULT_DIR"/
+  cp "$RESULT_DIR"/*.out* "$ALL_RESULT_DIR"/ || true
 done
 
+rebot -N acceptance -d "$ALL_RESULT_DIR" "$ALL_RESULT_DIR"/*.xml
+
 rebot -N "smoketests" -d "$SCRIPT_DIR/result" "$SCRIPT_DIR/result/robot-*.xml"

Review comment:
       I think this line should be removed:
   
   ```suggestion
   ```
   
   to avoid the following error:
   
   ```
   2020-07-29T10:07:38.2962715Z [ ERROR ] Reading XML source 
'/mnt/ozone/hadoop-ozone/dist/target/ozone-0.6.0-SNAPSHOT/compose/result/robot-*.xml'
 failed: No such file or directory
   ```

##########
File path: hadoop-ozone/dist/src/main/compose/ozone-topology/test.sh
##########
@@ -49,7 +49,7 @@ wait_for_port datanode_3 9858 60
 
 stop_containers datanode_4 datanode_5 datanode_6
 
-execute_robot_test scm topology/readdata.robot
+execute_robot_test scm topology/readdata.robot -N readdata-second-half

Review comment:
       ```suggestion
   execute_robot_test scm -N readdata-second-half topology/readdata.robot
   ```

##########
File path: hadoop-ozone/dist/src/test/shell/compose_testlib.bats
##########
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# 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.
+
+
+source ../../main/compose/testlib.sh
+@test "Find test recursive, only on one level" {
+  run find_tests
+  echo "x${output}x}"

Review comment:
       ```suggestion
   ```

##########
File path: hadoop-ozone/dist/src/test/shell/compose_testlib.bats
##########
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# 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.
+
+
+source ../../main/compose/testlib.sh
+@test "Find test recursive, only on one level" {
+  run find_tests
+  echo "x${output}x}"
+  [[ "$output" == "./test1/test.sh ./test2/test.sh ./test4/test.sh" ]]
+}
+
+source ../../main/compose/testlib.sh
+@test "Find test by suite" {
+  OZONE_ACCEPTANCE_SUITE=one
+  run find_tests
+  [[ "$output" == "./test4/test.sh" ]]
+}
+
+source ../../main/compose/testlib.sh
+@test "Find test default suite" {
+  OZONE_ACCEPTANCE_SUITE=misc
+  run find_tests

Review comment:
       ```suggestion
     cd $BATS_TEST_DIRNAME
     run find_tests
   ```

##########
File path: hadoop-ozone/dist/src/test/shell/compose_testlib.bats
##########
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# 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.
+
+
+source ../../main/compose/testlib.sh
+@test "Find test recursive, only on one level" {
+  run find_tests

Review comment:
       ```suggestion
     cd $BATS_TEST_DIRNAME
     run find_tests
   ```

##########
File path: hadoop-ozone/dist/src/test/shell/compose_testlib.bats
##########
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# 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.
+
+
+source ../../main/compose/testlib.sh
+@test "Find test recursive, only on one level" {
+  run find_tests
+  echo "x${output}x}"
+  [[ "$output" == "./test1/test.sh ./test2/test.sh ./test4/test.sh" ]]
+}
+
+source ../../main/compose/testlib.sh
+@test "Find test by suite" {
+  OZONE_ACCEPTANCE_SUITE=one
+  run find_tests
+  [[ "$output" == "./test4/test.sh" ]]
+}
+
+source ../../main/compose/testlib.sh

Review comment:
       ```suggestion
   load ../../main/compose/testlib.sh
   ```
   
   or
   
   ```suggestion
   ```

##########
File path: hadoop-ozone/dist/src/test/shell/compose_testlib.bats
##########
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# 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.
+
+
+source ../../main/compose/testlib.sh
+@test "Find test recursive, only on one level" {
+  run find_tests
+  echo "x${output}x}"
+  [[ "$output" == "./test1/test.sh ./test2/test.sh ./test4/test.sh" ]]
+}
+
+source ../../main/compose/testlib.sh
+@test "Find test by suite" {
+  OZONE_ACCEPTANCE_SUITE=one
+  run find_tests

Review comment:
       ```suggestion
     cd $BATS_TEST_DIRNAME
     run find_tests
   ```

##########
File path: hadoop-ozone/dist/src/test/shell/compose_testlib.bats
##########
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# 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.
+
+
+source ../../main/compose/testlib.sh
+@test "Find test recursive, only on one level" {
+  run find_tests
+  echo "x${output}x}"
+  [[ "$output" == "./test1/test.sh ./test2/test.sh ./test4/test.sh" ]]
+}
+
+source ../../main/compose/testlib.sh

Review comment:
       Can you please explain what's the purpose of repeatedly loading the 
library being tested?  In my experience it works fine with a single load, but 
maybe you want to cover some case I'm not aware of.
   
   ```suggestion
   load ../../main/compose/testlib.sh
   ```
   
   or
   
   ```suggestion
   ```

##########
File path: hadoop-ozone/dist/src/test/shell/compose_testlib.bats
##########
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# 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.
+
+
+source ../../main/compose/testlib.sh
+@test "Find test recursive, only on one level" {
+  run find_tests
+  echo "x${output}x}"
+  [[ "$output" == "./test1/test.sh ./test2/test.sh ./test4/test.sh" ]]
+}
+
+source ../../main/compose/testlib.sh

Review comment:
       Upgrade bats to 1.2.1.
   
   https://github.com/bats-core/bats-core/pull/282
   https://github.com/bats-core/bats-core/releases/tag/v1.2.1




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

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