This is an automated email from the ASF dual-hosted git repository.

laiyingchun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new c90aa4854 refactor(tests): Simplify the runtime module unit tests 
(#2115)
c90aa4854 is described below

commit c90aa4854fc16ec58a9ca1cab272fb136ec95361
Author: Yingchun Lai <[email protected]>
AuthorDate: Fri Sep 13 17:31:19 2024 +0800

    refactor(tests): Simplify the runtime module unit tests (#2115)
    
    Now the test `core.corrupt_message` is disabled by `--gtest_filter`, it's a
    bit of complex because it uses an external file
    (i.e. `src/runtime/test/gtest.filter`), and it just disable
    `core.corrupt_message` test case. This can be simplified by adding a
    `DISABLED_` prefix, and make sure all other test cases can be ran normally.
---
 .licenserc.yaml                      |  1 -
 src/runtime/test/CMakeLists.txt      |  3 +--
 src/runtime/test/corrupt_message.cpp |  4 +++-
 src/runtime/test/gtest.filter        |  3 ---
 src/runtime/test/run.sh              | 13 ++++++-------
 5 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/.licenserc.yaml b/.licenserc.yaml
index 71376cd10..d1ee6798d 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -61,7 +61,6 @@ header:
     - 'src/meta/test/suite2'
     - 'src/nfs/test/nfs_test_file1'
     - 'src/nfs/test/nfs_test_file2'
-    - 'src/runtime/test/gtest.filter'
     # Used for tests and should be empty, or ignore all comment lines 
(otherwise would lead to error).
     - 'src/utils/test/config-empty.ini'
     # Binary files used for tests and could not be added with copyright info 
(otherwise would lead to error).
diff --git a/src/runtime/test/CMakeLists.txt b/src/runtime/test/CMakeLists.txt
index 83e355c44..063fffda6 100644
--- a/src/runtime/test/CMakeLists.txt
+++ b/src/runtime/test/CMakeLists.txt
@@ -41,6 +41,5 @@ set(MY_BINPLACES
         config-test-sim.ini
         command.txt
         run.sh
-        clear.sh
-        gtest.filter)
+        clear.sh)
 dsn_add_test()
diff --git a/src/runtime/test/corrupt_message.cpp 
b/src/runtime/test/corrupt_message.cpp
index 6b1200fa6..c4f45b4b0 100644
--- a/src/runtime/test/corrupt_message.cpp
+++ b/src/runtime/test/corrupt_message.cpp
@@ -35,8 +35,10 @@
 #include "runtime/test_utils.h"
 #include "utils/error_code.h"
 
+// TODO(yingchun): the tests are failed because the fault injector is not work 
well as expected.
+//  Now just disable the tests before we fix it.
 // this only works with the fault injector
-TEST(core, corrupt_message)
+TEST(core, DISABLED_corrupt_message)
 {
     int req = 0;
     const auto server = dsn::rpc_address::from_host_port("localhost", 20101);
diff --git a/src/runtime/test/gtest.filter b/src/runtime/test/gtest.filter
deleted file mode 100644
index 2d19ecb8a..000000000
--- a/src/runtime/test/gtest.filter
+++ /dev/null
@@ -1,3 +0,0 @@
-config-test.ini 
-core.corrupt_message:core.aio*:core.operation_failed:tools_hpc.*
-config-test-sim.ini 
-core.corrupt_message:core.aio*:core.operation_failed:tools_hpc.*:tools_simulator.*:task_test.signal_finished_task
-config-test-sim.ini tools_simulator.*
diff --git a/src/runtime/test/run.sh b/src/runtime/test/run.sh
index ebb7925b6..96d0c1d45 100755
--- a/src/runtime/test/run.sh
+++ b/src/runtime/test/run.sh
@@ -28,13 +28,12 @@ if [ -z "${REPORT_DIR}" ]; then
     REPORT_DIR="."
 fi
 
-while read -r -a line; do
-    test_case=${line[0]}
-    gtest_filter=${line[1]}
+test_cases=(config-test.ini config-test-sim.ini)
+for test_case in ${test_cases[*]}; do
     output_xml="${REPORT_DIR}/dsn_runtime_tests_${test_case/.ini/.xml}"
-    echo "============ run dsn_runtime_tests ${test_case} with gtest_filter 
${gtest_filter} ============"
+    echo "============ run dsn_runtime_tests ${test_case} ============"
     ./clear.sh
-    GTEST_OUTPUT="xml:${output_xml}" GTEST_FILTER=${gtest_filter} 
./dsn_runtime_tests ${test_case} < command.txt
+    GTEST_OUTPUT="xml:${output_xml}" ./dsn_runtime_tests ${test_case} < 
command.txt
 
     if [ $? -ne 0 ]; then
         echo "run dsn_runtime_tests $test_case failed"
@@ -50,8 +49,8 @@ while read -r -a line; do
         fi
         exit 1
     fi
-    echo "============ done dsn_runtime_tests ${test_case} with gtest_filter 
${gtest_filter} ============"
-done <gtest.filter
+    echo "============ done dsn_runtime_tests ${test_case} ============"
+done
 
 echo "============ done dsn_runtime_tests ============"
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to