You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/04/11 10:30:23 UTC

[GitHub] [incubator-doris] yangzhg opened a new pull request, #8958: [refactor] Unify all unit tests into one binary file

yangzhg opened a new pull request, #8958:
URL: https://github.com/apache/incubator-doris/pull/8958

   
   # Proposed changes
   
   1. solved the previous delayed unit test file size is too large (1.7G+) and the unit test link time is too long problem problems
   2. Unify all unit tests into one file to significantly reduce unit test execution time to less than 3 mins
   3. temporarily disable `stream_load_test.cpp`, `metrics_action_test.cpp`, `load_channel_mgr_test.cpp` because it will re-implement part of the code and affect other tests
   
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (No)
   2. Has unit tests been added: (No Need)
   3. Has document been added or modified: No Need)
   4. Does it need to update dependencies: (No)
   5. Are there any changes that cannot be rolled back: (No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] zbtzbtzbt commented on pull request #8958: [refactor] Unify all unit tests into one binary file

Posted by GitBox <gi...@apache.org>.
zbtzbtzbt commented on PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#issuecomment-1095149930

   cool!


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #8958: [refactor] Unify all unit tests into one binary file

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#issuecomment-1096244717

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #8958: [refactor] Unify all unit tests into one binary file

Posted by GitBox <gi...@apache.org>.
yiguolei commented on code in PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#discussion_r847956940


##########
be/src/geo/geo_functions.cpp:
##########
@@ -267,22 +268,21 @@ doris_udf::BooleanVal GeoFunctions::st_contains(doris_udf::FunctionContext* ctx,
     if (state != nullptr && state->is_null) {
         return BooleanVal::null();
     }
-    GeoShape* shapes[2] = {nullptr, nullptr};
+    std::vector<std::shared_ptr<GeoShape>> shapes = {nullptr, nullptr};
     const StringVal* strs[2] = {&lhs, &rhs};
-    // use this to delete new
-    StContainsState local_state;
     for (int i = 0; i < 2; ++i) {
         if (state != nullptr && state->shapes[i] != nullptr) {
             shapes[i] = state->shapes[i];
         } else {
-            shapes[i] = local_state.shapes[i] = GeoShape::from_encoded(strs[i]->ptr, strs[i]->len);
+            shapes[i] =
+                    std::shared_ptr<GeoShape>(GeoShape::from_encoded(strs[i]->ptr, strs[i]->len));
             if (shapes[i] == nullptr) {
                 return BooleanVal::null();
             }
         }
     }
 
-    return shapes[0]->contains(shapes[1]);
+    return shapes[0]->contains(shapes[1].get());

Review Comment:
   Has to add get() here?



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yangzhg commented on a diff in pull request #8958: [refactor] Unify all unit tests into one binary file

Posted by GitBox <gi...@apache.org>.
yangzhg commented on code in PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#discussion_r847863370


##########
be/test/CMakeLists.txt:
##########
@@ -0,0 +1,389 @@
+# 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.
+
+# where to put generated libraries
+set(LIBRARY_OUTPUT_PATH "${BUILD_DIR}/test")
+
+# where to put generated libraries
+set(EXECUTABLE_OUTPUT_PATH "${BUILD_DIR}/test")
+
+set(AGENT_TEST_FILES
+    agent/utils_test.cpp
+    # agent/agent_server_test.cpp
+    # agent/cgroups_mgr_test.cpp
+    # agent/heartbeat_server_test.cpp
+)
+set(COMMON_TEST_FILES
+    common/resource_tls_test.cpp
+    common/status_test.cpp
+    common/config_test.cpp
+)
+set(ENV_TEST_FILES
+    env/env_posix_test.cpp
+)
+
+set(EXEC_TEST_FILES
+    exec/hash_table_test.cpp
+    exec/olap_common_test.cpp
+    exec/json_scanner_test.cpp
+    exec/json_scanner_with_jsonpath_test.cpp
+    exec/parquet_scanner_test.cpp
+    exec/orc_scanner_test.cpp
+    exec/plain_text_line_reader_uncompressed_test.cpp
+    exec/plain_text_line_reader_gzip_test.cpp
+    exec/plain_text_line_reader_bzip_test.cpp
+    exec/plain_text_line_reader_lz4frame_test.cpp
+    exec/broker_scanner_test.cpp
+    exec/broker_scan_node_test.cpp
+    exec/tablet_info_test.cpp
+    exec/tablet_sink_test.cpp
+    exec/buffered_reader_test.cpp
+    exec/es_http_scan_node_test.cpp
+    exec/es_predicate_test.cpp
+    exec/es_query_builder_test.cpp
+    exec/es_scan_reader_test.cpp
+    exec/s3_reader_test.cpp
+    exec/multi_bytes_separator_test.cpp
+    # exec/hdfs_file_reader_test.cpp

Review Comment:
   use testName



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yangzhg commented on a diff in pull request #8958: [refactor] Unify all unit tests into one binary file

Posted by GitBox <gi...@apache.org>.
yangzhg commented on code in PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#discussion_r848006064


##########
be/src/geo/geo_functions.cpp:
##########
@@ -267,22 +268,21 @@ doris_udf::BooleanVal GeoFunctions::st_contains(doris_udf::FunctionContext* ctx,
     if (state != nullptr && state->is_null) {
         return BooleanVal::null();
     }
-    GeoShape* shapes[2] = {nullptr, nullptr};
+    std::vector<std::shared_ptr<GeoShape>> shapes = {nullptr, nullptr};
     const StringVal* strs[2] = {&lhs, &rhs};
-    // use this to delete new
-    StContainsState local_state;
     for (int i = 0; i < 2; ++i) {
         if (state != nullptr && state->shapes[i] != nullptr) {
             shapes[i] = state->shapes[i];
         } else {
-            shapes[i] = local_state.shapes[i] = GeoShape::from_encoded(strs[i]->ptr, strs[i]->len);
+            shapes[i] =
+                    std::shared_ptr<GeoShape>(GeoShape::from_encoded(strs[i]->ptr, strs[i]->len));
             if (shapes[i] == nullptr) {
                 return BooleanVal::null();
             }
         }
     }
 
-    return shapes[0]->contains(shapes[1]);
+    return shapes[0]->contains(shapes[1].get());

Review Comment:
   `contains` only accept raw pointer



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yangzhg commented on a diff in pull request #8958: [refactor] Unify all unit tests into one binary file

Posted by GitBox <gi...@apache.org>.
yangzhg commented on code in PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#discussion_r847874533


##########
be/src/geo/geo_functions.cpp:
##########
@@ -236,7 +236,8 @@ void GeoFunctions::st_contains_prepare(doris_udf::FunctionContext* ctx,
             if (str->is_null) {
                 contains_ctx->is_null = true;
             } else {
-                contains_ctx->shapes[i] = GeoShape::from_encoded(str->ptr, str->len);
+                contains_ctx->shapes[i] =
+                        std::shared_ptr<GeoShape>(GeoShape::from_encoded(str->ptr, str->len));

Review Comment:
   shapes may share at line 275 



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #8958: [refactor] Unify all unit tests into one binary file

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#issuecomment-1096244780

   PR approved by anyone and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a diff in pull request #8958: [refactor] Unify all unit tests into one binary file

Posted by GitBox <gi...@apache.org>.
morningman commented on code in PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#discussion_r847387912


##########
be/src/geo/geo_functions.cpp:
##########
@@ -236,7 +236,8 @@ void GeoFunctions::st_contains_prepare(doris_udf::FunctionContext* ctx,
             if (str->is_null) {
                 contains_ctx->is_null = true;
             } else {
-                contains_ctx->shapes[i] = GeoShape::from_encoded(str->ptr, str->len);
+                contains_ctx->shapes[i] =
+                        std::shared_ptr<GeoShape>(GeoShape::from_encoded(str->ptr, str->len));

Review Comment:
   Why using shared_ptr instead of unique_ptr?



##########
run-be-ut.sh:
##########
@@ -242,15 +229,11 @@ if [ ${VECTORIZED_ONLY} -eq 1 ]; then
     echo "Run Vectorized ut only"
     export DORIS_TEST_BINARY_DIR=${DORIS_TEST_BINARY_DIR}/vec
 fi
-
-test_files=`find ${DORIS_TEST_BINARY_DIR} -type f -perm -111 -name "*test"`
-
-for test in ${test_files[@]}
-do
-    file_name=${test##*/}
-    if [ -z $RUN_FILE ] || [ $file_name == $RUN_FILE ]; then
-        echo "=== Run $file_name ==="
-        $test --gtest_output=xml:${GTEST_OUTPUT_DIR}/${file_name}.xml
-    fi
-done
-echo "=== Finished. Gtest output: ${GTEST_OUTPUT_DIR}"
+test=${DORIS_TEST_BINARY_DIR}doris_be_test
+echo "${FILTER}"
+if [ -f "$test" ]; then
+    $test --gtest_output=xml:${GTEST_OUTPUT_DIR}/${file_name}.xml  --gtest_print_time=true "${FILTER}"

Review Comment:
   `${file_name}` is not defined



##########
be/test/CMakeLists.txt:
##########
@@ -0,0 +1,389 @@
+# 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.
+
+# where to put generated libraries
+set(LIBRARY_OUTPUT_PATH "${BUILD_DIR}/test")
+
+# where to put generated libraries
+set(EXECUTABLE_OUTPUT_PATH "${BUILD_DIR}/test")
+
+set(AGENT_TEST_FILES
+    agent/utils_test.cpp
+    # agent/agent_server_test.cpp
+    # agent/cgroups_mgr_test.cpp
+    # agent/heartbeat_server_test.cpp
+)
+set(COMMON_TEST_FILES
+    common/resource_tls_test.cpp
+    common/status_test.cpp
+    common/config_test.cpp
+)
+set(ENV_TEST_FILES
+    env/env_posix_test.cpp
+)
+
+set(EXEC_TEST_FILES
+    exec/hash_table_test.cpp
+    exec/olap_common_test.cpp
+    exec/json_scanner_test.cpp
+    exec/json_scanner_with_jsonpath_test.cpp
+    exec/parquet_scanner_test.cpp
+    exec/orc_scanner_test.cpp
+    exec/plain_text_line_reader_uncompressed_test.cpp
+    exec/plain_text_line_reader_gzip_test.cpp
+    exec/plain_text_line_reader_bzip_test.cpp
+    exec/plain_text_line_reader_lz4frame_test.cpp
+    exec/broker_scanner_test.cpp
+    exec/broker_scan_node_test.cpp
+    exec/tablet_info_test.cpp
+    exec/tablet_sink_test.cpp
+    exec/buffered_reader_test.cpp
+    exec/es_http_scan_node_test.cpp
+    exec/es_predicate_test.cpp
+    exec/es_query_builder_test.cpp
+    exec/es_scan_reader_test.cpp
+    exec/s3_reader_test.cpp
+    exec/multi_bytes_separator_test.cpp
+    # exec/hdfs_file_reader_test.cpp

Review Comment:
   How to address these tests?



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yangzhg commented on a diff in pull request #8958: [refactor] Unify all unit tests into one binary file

Posted by GitBox <gi...@apache.org>.
yangzhg commented on code in PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#discussion_r847863370


##########
be/test/CMakeLists.txt:
##########
@@ -0,0 +1,389 @@
+# 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.
+
+# where to put generated libraries
+set(LIBRARY_OUTPUT_PATH "${BUILD_DIR}/test")
+
+# where to put generated libraries
+set(EXECUTABLE_OUTPUT_PATH "${BUILD_DIR}/test")
+
+set(AGENT_TEST_FILES
+    agent/utils_test.cpp
+    # agent/agent_server_test.cpp
+    # agent/cgroups_mgr_test.cpp
+    # agent/heartbeat_server_test.cpp
+)
+set(COMMON_TEST_FILES
+    common/resource_tls_test.cpp
+    common/status_test.cpp
+    common/config_test.cpp
+)
+set(ENV_TEST_FILES
+    env/env_posix_test.cpp
+)
+
+set(EXEC_TEST_FILES
+    exec/hash_table_test.cpp
+    exec/olap_common_test.cpp
+    exec/json_scanner_test.cpp
+    exec/json_scanner_with_jsonpath_test.cpp
+    exec/parquet_scanner_test.cpp
+    exec/orc_scanner_test.cpp
+    exec/plain_text_line_reader_uncompressed_test.cpp
+    exec/plain_text_line_reader_gzip_test.cpp
+    exec/plain_text_line_reader_bzip_test.cpp
+    exec/plain_text_line_reader_lz4frame_test.cpp
+    exec/broker_scanner_test.cpp
+    exec/broker_scan_node_test.cpp
+    exec/tablet_info_test.cpp
+    exec/tablet_sink_test.cpp
+    exec/buffered_reader_test.cpp
+    exec/es_http_scan_node_test.cpp
+    exec/es_predicate_test.cpp
+    exec/es_query_builder_test.cpp
+    exec/es_scan_reader_test.cpp
+    exec/s3_reader_test.cpp
+    exec/multi_bytes_separator_test.cpp
+    # exec/hdfs_file_reader_test.cpp

Review Comment:
   use testName like TestEngineStorageMigrationTask



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yiguolei merged pull request #8958: [refactor] Unify all unit tests into one binary file

Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org