You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/07/27 09:49:58 UTC

[GitHub] [hadoop-ozone] elek opened a new pull request #1263: HDDS-4033 Make the acceptance test reports hierarchical

elek opened a new pull request #1263:
URL: https://github.com/apache/hadoop-ozone/pull/1263


   ## What changes were proposed in this pull request?
   
   Acceptance test reports of today uses a generated name for each of the executed robot tests.
   
   Instead of using a flat structure with generated name it seems to be better to use a hierarchical structure which represents the directory structure.
   
   before:
   
   ![image](https://user-images.githubusercontent.com/170549/88528628-29049e00-cfff-11ea-9c61-c1bddcb80e23.png)
   
   after:
   
   ![image](https://user-images.githubusercontent.com/170549/88528647-2e61e880-cfff-11ea-99f8-75fa10b7c575.png)
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4033
   
   ## How was this patch tested?
   
   Running CI on my fork:
   
   https://github.com/elek/hadoop-ozone/runs/911471446?check_suite_focus=true
   
   See the attached artifacts


----------------------------------------------------------------
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:
users@infra.apache.org



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


[GitHub] [hadoop-ozone] elek commented on a change in pull request #1263: HDDS-4033. Make the acceptance test reports hierarchical

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #1263:
URL: https://github.com/apache/hadoop-ozone/pull/1263#discussion_r462120888



##########
File path: hadoop-ozone/dist/src/main/compose/ozone/test.sh
##########
@@ -35,14 +35,14 @@ execute_robot_test scm gdpr
 
 for scheme in ofs o3fs; do
   for bucket in link bucket; do
-    execute_robot_test scm -v SCHEME:${scheme} -v BUCKET_TYPE:${bucket} ozonefs/ozonefs.robot
+    execute_robot_test scm -v SCHEME:${scheme} -v BUCKET_TYPE:${bucket} -N ozonefs-${scheme}-${bucket} ozonefs/ozonefs.robot

Review comment:
       :+1: 

##########
File path: hadoop-ozone/dist/src/main/compose/test-all.sh
##########
@@ -46,9 +46,12 @@ for test in $(find "$SCRIPT_DIR" -name test.sh | grep "${OZONE_TEST_SELECTOR:-""
       echo "ERROR: Test execution of $(dirname "$test") is FAILED!!!!"
   fi
   RESULT_DIR="$(dirname "$test")/result"
-  cp "$RESULT_DIR"/robot-*.xml "$RESULT_DIR"/docker-*.log "$RESULT_DIR"/*.out* "$ALL_RESULT_DIR"/
+  rebot -N $(basename $(dirname "$test")) -o "$ALL_RESULT_DIR"/$(basename $(dirname "$test")).xml "$RESULT_DIR"/*.xml

Review comment:
       done (got `${d}` with the rebase...)

##########
File path: hadoop-ozone/dist/src/main/compose/ozone-mr/test.sh
##########
@@ -0,0 +1,32 @@
+# 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.
+SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )
+ALL_RESULT_DIR="$SCRIPT_DIR/result"
+set -x
+RESULT=0
+IFS=$'\n'
+# shellcheck disable=SC2044
+for test in $(find "$SCRIPT_DIR" -mindepth 2 -maxdepth 2 -name test.sh | grep "${OZONE_TEST_SELECTOR:-""}" |sort); do

Review comment:
       Hmm. I think I should move out the tricky `find` segment (contains the `#suite` support) to the `testlib.sh` and reuse it from the second level `test.sh`.

##########
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:
       Yes, I learned from you that `load` can be used, but it doesnt work for me:
   
   ```
   bats compose_testlib.bats
   bats: /home/elek/projects/ozone/hadoop-ozone/dist/src/test/shell/../../main/compose/testlib.sh.bash does not exist
   ```
   
   Don't know why....




----------------------------------------------------------------
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:
users@infra.apache.org



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


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #1263: HDDS-4033. Make the acceptance test reports hierarchical

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



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


[GitHub] [hadoop-ozone] adoroszlai merged pull request #1263: HDDS-4033. Make the acceptance test reports hierarchical

Posted by GitBox <gi...@apache.org>.
adoroszlai merged pull request #1263:
URL: https://github.com/apache/hadoop-ozone/pull/1263


   


----------------------------------------------------------------
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:
users@infra.apache.org



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