Skip to content

Commit d8bed29

Browse files
PS-10014 feature: Add Valgrind testing to the CI
https://perconadev.atlassian.net/browse/PS-10014 Added new "GCC 14 Valgrind" matrix job to GitHub Actions that builds project using "debug_gcc14" CMake preset and run MTR with '--valgrind' option. Currently we enabled running MTR under Valgrind only for 8.4 server in order to save GitHub Action resources. For Valgrind configuration we now also run 'ctest' with '-T memcheck' command line parameter, which instructs CTest to use default memory checking tool ('Valgrind') when running individual tests.
1 parent 4d73e97 commit d8bed29

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

.github/workflows/cmake.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ jobs:
6767
name: "GCC 14 Debug",
6868
label: "debug_gcc14",
6969
run_mtr: true,
70+
mtr_options: "--repeat=2",
7071
run_ctest: true
7172
}
7273
- {
7374
name: "GCC 14 RelWithDebInfo",
7475
label: "release_gcc14",
7576
run_mtr: true,
77+
mtr_options: "--repeat=2",
7678
run_ctest: true
7779
}
7880
- {
@@ -82,6 +84,14 @@ jobs:
8284
mtr_options: "--sanitize",
8385
run_ctest: true
8486
}
87+
- {
88+
name: "GCC 14 Valgrind",
89+
label: "debug_gcc14",
90+
run_mtr: true,
91+
mtr_options: "--valgrind",
92+
run_ctest: true,
93+
ctest_options: "-T memcheck"
94+
}
8595
- {
8696
name: "Clang 20 Debug",
8797
label: "debug_clang20",
@@ -136,6 +146,15 @@ jobs:
136146
run: |
137147
sudo apt-get install g++-14
138148
149+
- name: Install Valgrind on ubuntu
150+
if: endsWith(matrix.config.name, 'Valgrind')
151+
# installing Valgrind 3.25 here from Ubuntu 25.10 that has support for syscall 333
152+
run: |
153+
sudo apt-get install libc6-dbg
154+
wget -q http://mirrors.kernel.org/ubuntu/pool/main/v/valgrind/valgrind_3.25.1-0ubuntu1_amd64.deb
155+
sudo dpkg -i valgrind_3.25.1-0ubuntu1_amd64.deb
156+
rm -f valgrind_3.25.1-0ubuntu1_amd64.deb
157+
139158
- name: Fixing libaio1 for MySQL Server tarball
140159
if: matrix.config.run_mtr
141160
run: |
@@ -257,7 +276,7 @@ jobs:
257276
run: mkdir -p ${{github.workspace}}/dist
258277

259278
- name: Unpacking MySQL Server 8.0 tarballs
260-
if: matrix.config.run_mtr
279+
if: matrix.config.run_mtr && !endsWith(matrix.config.name, 'Valgrind')
261280
working-directory: ${{github.workspace}}/dist
262281
run: |
263282
# https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.45-linux-glibc2.28-x86_64.tar.xz
@@ -295,12 +314,12 @@ jobs:
295314
./${DIST_BASE_NAME}/bin/mysqld --version
296315
297316
- name: MTR 8.0 tests
298-
if: matrix.config.run_mtr
317+
if: matrix.config.run_mtr && !endsWith(matrix.config.name, 'Valgrind')
299318
working-directory: ${{github.workspace}}/dist/${{format('mysql-{0}-{1}', env.MYSQL_80_VERSION, env.MYSQL_GLIBC_SUFFIX)}}/mysql-test
300319
run: |
301320
BINSRV=${{github.workspace}}/src-build-${{matrix.config.label}}/binlog_server ./mtr \
302321
--vardir=${{runner.temp}}/mtrvardir80 \
303-
--force --max-test-fail=0 --retry=0 --nounit-tests --big-test --repeat=2 --parallel=${{steps.cpu-cores.outputs.count}} \
322+
--force --max-test-fail=0 --retry=0 --nounit-tests --big-test --parallel=${{steps.cpu-cores.outputs.count}} \
304323
--suite=binlog_streaming ${{matrix.config.mtr_options}}
305324
306325
- name: MTR 8.4 tests
@@ -309,15 +328,15 @@ jobs:
309328
run: |
310329
BINSRV=${{github.workspace}}/src-build-${{matrix.config.label}}/binlog_server ./mtr \
311330
--vardir=${{runner.temp}}/mtrvardir84 \
312-
--force --max-test-fail=0 --retry=0 --nounit-tests --big-test --repeat=2 --parallel=${{steps.cpu-cores.outputs.count}} \
331+
--force --max-test-fail=0 --retry=0 --nounit-tests --big-test --parallel=${{steps.cpu-cores.outputs.count}} \
313332
--suite=binlog_streaming ${{matrix.config.mtr_options}}
314333
315334
- name: CTest
316335
if: matrix.config.run_ctest
317336
working-directory: ${{github.workspace}}/src-build-${{matrix.config.label}}
318337
# Execute tests defined by the CMake configuration.
319338
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
320-
run: ctest --parallel
339+
run: ctest --parallel ${{matrix.config.ctest_options}}
321340

322341
- name: Info Build artifacts
323342
run: |

0 commit comments

Comments
 (0)