Skip to content

Commit

Permalink
add benchmark into github action test
Browse files Browse the repository at this point in the history
  • Loading branch information
hnwyllmm committed Jan 15, 2024
1 parent 0b534fd commit 2be1487
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
# sysbench cannot work property on this platform.
# I found that sysbench would send more request before receiving last response
sysbench-test:
strategy:
matrix:
thread_model: ['one-thread-per-connection', 'java-thread-pool']

runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
Expand All @@ -45,7 +49,7 @@ jobs:
run: |
sudo bash build.sh init
bash build.sh release -DCONCURRENCY=ON -DWITH_UNIT_TESTS=OFF
nohup ./build_release/bin/observer -s /tmp/miniob.sock -f etc/observer.ini -P mysql -t mvcc &
nohup ./build_release/bin/observer -T ${{ matrix.thread_model }} -s /tmp/miniob.sock -f etc/observer.ini -P mysql -t mvcc &
sleep 10 && echo "wake up"
mysql --version
mysql -S /tmp/miniob.sock -e "show tables"
Expand All @@ -56,3 +60,21 @@ jobs:
cd test/sysbench
sysbench --mysql-socket=/tmp/miniob.sock --threads=10 miniob_insert prepare
sysbench --mysql-socket=/tmp/miniob.sock --threads=10 miniob_insert run
benchmark-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2

- name: build observer and benchmark
shell: bash
run: |
sudo bash build.sh init
bash build.sh release -DCONCURRENCY=ON -DWITH_UNIT_TESTS=OFF -DWITH_BENCHMARK=ON
- name: testing
shell: bash
run: |
cd build_release/bin/
find ./ -name "*_concurrency_test" | xargs time
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ OPTION(ENABLE_ASAN "Enable build with address sanitizer" ON)
OPTION(ENABLE_TSAN "Build with thread sanitizer" OFF)
OPTION(ENABLE_UBSAN "Build with undefined behavior sanitizer" OFF)
OPTION(WITH_UNIT_TESTS "Compile miniob with unit tests" ON)
OPTION(WITH_BENCHMARK "Compile benchmark" OFF)
OPTION(ENABLE_COVERAGE "Enable unittest coverage" OFF)
OPTION(CONCURRENCY "Support concurrency operations" OFF)
OPTION(STATIC_STDLIB "Link std library static or dynamic, such as libgcc, libstdc++, libasan" OFF)
Expand Down Expand Up @@ -144,9 +145,12 @@ ADD_SUBDIRECTORY(deps)
ADD_SUBDIRECTORY(src/obclient)
ADD_SUBDIRECTORY(src/observer)
ADD_SUBDIRECTORY(test/perf)
ADD_SUBDIRECTORY(benchmark)
ADD_SUBDIRECTORY(tools)

IF (WITH_BENCHMARK)
ADD_SUBDIRECTORY(benchmark)
ENDIF(WITH_BENCHMARK)

IF(WITH_UNIT_TESTS)
ADD_SUBDIRECTORY(unittest)
ENDIF(WITH_UNIT_TESTS)
Expand Down

0 comments on commit 2be1487

Please sign in to comment.