Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(build): Unify build and test shell scripts to run.sh #1062

Merged
merged 9 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions .github/workflows/lint_and_test_cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,15 @@ jobs:
mkdir build
cmake -DCMAKE_BUILD_TYPE=Release -B build/
cmake --build build/ -j $(($(nproc)/2+1))
- name: Compilation and Unit Testing
- name: Compilation
if: steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
run: ./run.sh build -c --rdsn --test --skip_thirdparty -j $(($(nproc)/2+1))
- name: Unit Testing
if: steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
run: |
export LD_LIBRARY_PATH=`pwd`/thirdparty/output/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
ulimit -s unlimited
./run.sh build -c --rdsn --test --skip_thirdparty -j $(($(nproc)/2+1))
./run.sh test --rdsn

test_rdsn_ASAN:
name: Test rdsn with ASAN
Expand Down Expand Up @@ -129,12 +132,15 @@ jobs:
mkdir build
cmake -DCMAKE_BUILD_TYPE=Release -B build/
cmake --build build/ -j $(($(nproc)/2+1))
- name: Compilation and Unit Testing
- name: Compilation
if: steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
run: ./run.sh build -c --rdsn --test --sanitizer address --skip_thirdparty --disable_gperf -j $(($(nproc)/2+1))
- name: Unit Testing
if: steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
run: |
export LD_LIBRARY_PATH=`pwd`/thirdparty/output/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
ulimit -s unlimited
./run.sh build -c --rdsn --test --sanitizer address --skip_thirdparty --disable_gperf -j $(($(nproc)/2+1))
./run.sh test --rdsn

test_rdsn_LSAN:
name: Test rdsn with LSAN
Expand Down Expand Up @@ -170,12 +176,15 @@ jobs:
mkdir build
cmake -DCMAKE_BUILD_TYPE=Release -B build/
cmake --build build/ -j $(($(nproc)/2+1))
- name: Compilation and Unit Testing
- name: Compilation
if: steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
run: ./run.sh build -c --rdsn --test --sanitizer leak --skip_thirdparty --disable_gperf -j $(($(nproc)/2+1))
- name: Unit Testing
if: steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
run: |
export LD_LIBRARY_PATH=`pwd`/thirdparty/output/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
ulimit -s unlimited
./run.sh build -c --rdsn --test --sanitizer leak --skip_thirdparty --disable_gperf -j $(($(nproc)/2+1))
./run.sh test --rdsn

test_rdsn_UBSAN:
name: Test rdsn with UBSAN
Expand Down Expand Up @@ -211,13 +220,17 @@ jobs:
mkdir build
cmake -DCMAKE_BUILD_TYPE=Release -B build/
cmake --build build/ -j $(($(nproc)/2+1))
- name: Compilation and Unit Testing
- name: Compilation
if: steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
run: ./run.sh build -c --rdsn --test --sanitizer undefined --skip_thirdparty --disable_gperf -j $(($(nproc)/2+1))
- name: Unit Testing
if: steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
run: |
export LD_LIBRARY_PATH=`pwd`/thirdparty/output/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
ulimit -s unlimited
./run.sh build -c --rdsn --test --sanitizer undefined --skip_thirdparty --disable_gperf -j $(($(nproc)/2+1))
./run.sh test --rdsn

# TODO(yingchun): also need to test ASAN, LSAN, UBSAN
test_pegasus:
name: Test Pegasus
needs: cpp_clang_format_linter
Expand Down Expand Up @@ -249,7 +262,7 @@ jobs:
cmake --build build/ -j $(($(nproc)/2+1))
- name: Compilation
if: steps.changes.outputs.pegasus == 'true' || steps.changes.outputs.thirdparty == 'true'
run: ./run.sh build -c -j $(($(nproc)/2+1))
run: ./run.sh build --test -c -j $(($(nproc)/2+1))
- name: Packaging Server
if: steps.changes.outputs.pegasus == 'true' || steps.changes.outputs.thirdparty == 'true'
run: ./run.sh pack_server
Expand Down
4 changes: 1 addition & 3 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ header:
- 'src/rdsn/src/utils/test/config-empty.ini'
# The MIT License (MIT), Copyright (c) 2015 Microsoft Corporation
- 'cmake_modules/BaseFunctions.cmake'
- 'scripts/learn_stat.py'
- 'src/rdsn/README.md'
- 'src/rdsn/compile_thrift.py'
- 'src/rdsn/include/dsn/c/api_common.h'
Expand Down Expand Up @@ -201,9 +202,6 @@ header:
- 'src/rdsn/include/dsn/utility/utils.h'
- 'src/rdsn/include/dsn/utility/work_queue.h'
- 'src/rdsn/include/dsn/utils/time_utils.h'
- 'src/rdsn/scripts/linux/build.sh'
- 'src/rdsn/scripts/linux/install.sh'
- 'src/rdsn/scripts/linux/learn_stat.py'
- 'src/rdsn/src/aio/aio_provider.cpp'
- 'src/rdsn/src/aio/aio_provider.h'
- 'src/rdsn/src/aio/disk_engine.cpp'
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
set(PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(THIRDPARTY_ROOT ${PROJECT_ROOT}/thirdparty)
set(THIRDPARTY_INSTALL_DIR ${PROJECT_ROOT}/thirdparty/output)
message(STATUS "THIRDPARTY_INSTALL_DIR = ${THIRDPARTY_INSTALL_DIR}")

# TODO(yingchun): we will remove it later
# Set DSN_ROOT to ./DSN_ROOT, this is where rdsn will be installed
Expand Down
7 changes: 6 additions & 1 deletion cmake_modules/BaseFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ function(dsn_add_object)
endfunction(dsn_add_object)

function(dsn_add_test)
add_definitions(-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=0)
if(${BUILD_TEST})
add_definitions(-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=0)
set(MY_EXECUTABLE_IS_TEST TRUE)
dsn_add_executable()

Expand Down Expand Up @@ -359,6 +359,11 @@ function(dsn_setup_thirdparty_libs)
if (NOT APPLE)
link_directories(${THIRDPARTY_INSTALL_DIR}/lib64)
endif()

if (APPLE)
include_directories(${MACOS_OPENSSL_ROOT_DIR}/include)
link_directories(${MACOS_OPENSSL_ROOT_DIR}/lib)
endif()
endfunction(dsn_setup_thirdparty_libs)

function(dsn_common_setup)
Expand Down
Loading