Skip to content

Commit 0c4e833

Browse files
committed
ci: build + run Qt-side tests on Linux and Windows (Qt6); fix TSan regex
The parent CI workflows (ci-linux.yml, ci-macos.yml, ci-win.yml) previously produced release artifacts only and did not exercise the test suite -- the Qt-side tests (test_syncservice, test_sync_classifier, test_sync_ops, test_syncops_gate_release, test_syncservice_lifecycle, test_syncservice_credentials_cleanup, etc.) had zero CI coverage. Add ctest invocation after the packaging build on: - ci-linux.yml: full ctest with QT_QPA_PLATFORM=offscreen and LD_LIBRARY_PATH pointing at the in-build libVTextEdit.so so Qt-side test exes resolve the shared lib at load time. - ci-win.yml: ctest gated on matrix.config.qt_major == 6 (the Qt5 entry must remain packaging-only because tests/CMakeLists.txt hard-requires find_package(Qt6 REQUIRED)). VNOTE_BUILD_TESTS now toggles based on qt_major instead of being unconditionally OFF. Also fix ci-linux-tsan.yml regex so test_vxcore_sync_is_registered (introduced in 4fca0d8 in libs/vxcore) is picked up under ThreadSanitizer. test_vxcore_sync_cancellable_api and test_sync_credentials_api were also missing from the regex; added them for completeness. ci-macos.yml is left untouched here; macOS test enablement requires similar offscreen setup and is out of scope for this immediate sync-fix follow-up.
1 parent 925e069 commit 0c4e833

3 files changed

Lines changed: 34 additions & 2 deletions

File tree

.github/workflows/ci-linux-tsan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
- name: Run Sync Test Subset (ThreadSanitizer)
106106
run: |
107107
ctest --test-dir libs/vxcore/build_test -C Debug \
108-
-R "^test_(sync|git_sync|gitkeep|mock_sync_backend|libgit2_init|sync_backend_metadata|sync_backend_registry|git_backend_autoreg|sync_manager_factory_override|sync_manager_unknown_backend|git_options|credential_provider|sync_backend_with_provider|event_manager|buffer_save|libgit2_init_propagation|sync_config_backcompat|sync_status_queries|sync_config_cache|dirty_tracker|sync_manager_reentrancy|sync_thread_safety)$" \
108+
-R "^test_(sync|git_sync|gitkeep|mock_sync_backend|libgit2_init|sync_backend_metadata|sync_backend_registry|git_backend_autoreg|sync_manager_factory_override|sync_manager_unknown_backend|git_options|credential_provider|sync_backend_with_provider|event_manager|buffer_save|libgit2_init_propagation|sync_config_backcompat|sync_status_queries|sync_config_cache|dirty_tracker|sync_manager_reentrancy|sync_thread_safety|vxcore_sync_is_registered|vxcore_sync_cancellable_api|sync_credentials_api)$" \
109109
--output-on-failure
110110
env:
111111
TSAN_OPTIONS: "halt_on_error=1:exitcode=66"

.github/workflows/ci-linux.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,21 @@ jobs:
121121
cmake --build . --target pack
122122
working-directory: ${{runner.workspace}}/build
123123

124+
- name: Build and Run Tests
125+
# Build remaining targets (Qt-side tests + vxcore tests; --target pack
126+
# above only built the AppImage target) then run them headlessly via
127+
# the Qt offscreen platform plugin. VNOTE_BUILD_TESTS defaults to ON
128+
# in the root CMakeLists.txt, so no extra -D is needed.
129+
run: |
130+
set -e
131+
cmake --build .
132+
export QT_QPA_PLATFORM=offscreen
133+
# libVTextEdit.so lives next to the parent build's vnote binary;
134+
# add it to LD_LIBRARY_PATH so Qt-side test exes resolve it at load.
135+
export LD_LIBRARY_PATH="${{runner.workspace}}/build/libs/vtextedit/src:${LD_LIBRARY_PATH:-}"
136+
ctest --output-on-failure
137+
working-directory: ${{runner.workspace}}/build
138+
124139
- name: Fix Package
125140
run: |
126141
mkdir fixpackage

.github/workflows/ci-win.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,35 @@ jobs:
123123
QT_MAJOR: ${{ matrix.config.qt_major }}
124124
VS_CMD: ${{ matrix.config.vs_cmd }}
125125
RUNNER_WORKSPACE: ${{ runner.workspace }}
126+
# tests/CMakeLists.txt hard-requires Qt6 (find_package(Qt6 REQUIRED)),
127+
# so the Qt5 matrix entry MUST build packaging-only. Qt6 entry builds
128+
# tests so the Build-and-Run-Tests step below can ctest them.
129+
VNOTE_TESTS: ${{ matrix.config.qt_major == 6 && 'ON' || 'OFF' }}
126130
run: |
127131
cmake --version
128132
if "%QT_MAJOR%"=="6" call "%VS_CMD%"
129133
where cl || echo "cl.exe not on PATH"
130-
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DQT_DEFAULT_MAJOR_VERSION=%QT_MAJOR% -DVNOTE_BUILD_TESTS=OFF -DOPENSSL_EXTRA_LIB_DIR=%RUNNER_WORKSPACE%\build\openssl-utils.git\1.1.1j\Win_x64 %GITHUB_WORKSPACE% > cmake-configure.log 2>&1 || (type cmake-configure.log && exit /b 1)
134+
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DQT_DEFAULT_MAJOR_VERSION=%QT_MAJOR% -DVNOTE_BUILD_TESTS=%VNOTE_TESTS% -DOPENSSL_EXTRA_LIB_DIR=%RUNNER_WORKSPACE%\build\openssl-utils.git\1.1.1j\Win_x64 %GITHUB_WORKSPACE% > cmake-configure.log 2>&1 || (type cmake-configure.log && exit /b 1)
131135
type cmake-configure.log
132136
cmake --build .
133137
cmake --build . --target=pack
134138
7z x VNote*.zip -o*
135139
dir
136140
working-directory: ${{runner.workspace}}/build
137141

142+
- name: Build and Run Tests (Qt6 only)
143+
# tests/CMakeLists.txt hard-requires Qt6 so this step is skipped on
144+
# the Qt5 matrix entry. The previous step already built tests when
145+
# VNOTE_BUILD_TESTS=ON, so ctest only needs to dispatch them.
146+
if: ${{ matrix.config.qt_major == 6 }}
147+
shell: cmd
148+
env:
149+
VS_CMD: ${{ matrix.config.vs_cmd }}
150+
run: |
151+
call "%VS_CMD%"
152+
ctest -C Release --output-on-failure
153+
working-directory: ${{runner.workspace}}/build
154+
138155
- name: Assert MSVC v142 + Qt 5.15.2 in use
139156
if: ${{ matrix.config.qt_major == 5 }}
140157
shell: bash

0 commit comments

Comments
 (0)