Skip to content

Commit

Permalink
refactor(tests): Simplify the runtime module unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Sep 13, 2024
1 parent adb886d commit df6a860
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
1 change: 0 additions & 1 deletion .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
3 changes: 1 addition & 2 deletions src/runtime/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ set(MY_BINPLACES
config-test-sim.ini
command.txt
run.sh
clear.sh
gtest.filter)
clear.sh)
dsn_add_test()
2 changes: 1 addition & 1 deletion src/runtime/test/corrupt_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "utils/error_code.h"

// 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);
Expand Down
3 changes: 0 additions & 3 deletions src/runtime/test/gtest.filter

This file was deleted.

13 changes: 6 additions & 7 deletions src/runtime/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 ============"

0 comments on commit df6a860

Please sign in to comment.