Skip to content

Add VECSIM_BUILD_TEST_HELPERS option to CMAKE#913

Merged
dor-forer merged 6 commits intomainfrom
dorer-add-VECSIM_BUILD_TEST_HELPERS
Feb 26, 2026
Merged

Add VECSIM_BUILD_TEST_HELPERS option to CMAKE#913
dor-forer merged 6 commits intomainfrom
dorer-add-VECSIM_BUILD_TEST_HELPERS

Conversation

@dor-forer
Copy link
Collaborator

@dor-forer dor-forer commented Feb 26, 2026

Describe the changes in the pull request

Added VECSIM_BUILD_TEST_HELPERS flag to the CMAKE to allow vecsim_disk to compile the test helper function without compiling the tests themselves.
VECSIM_BUILD_TEST_HELPERS is defaulted to OFF, so we don't have to change RediSearch's behaviour.
Commented that setting VECSIM_BUILD_TESTS to ON includes the buiding the test helper functions.

Which issues this PR fixes

  1. #...
  2. MOD...

Main objects this PR modified

  1. ...
  2. ...

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Note

Low Risk
Low risk build-system change that mainly affects compilation flags and target inclusion when enabling test helpers; main risk is accidental BUILD_TESTS define/link changes for downstream consumers.

Overview
Adds a new CMake option VECSIM_BUILD_TEST_HELPERS (default OFF) to compile test helper methods behind BUILD_TESTS without fetching/building test executables.

Updates build logic so BUILD_TESTS and the VectorSimilaritySerializer library are enabled when either helpers or full tests are requested, while googletest/benchmark and test targets are built only when VECSIM_BUILD_TESTS is ON. Also switches SVS factory test-only overload guards from #if BUILD_TESTS to #ifdef BUILD_TESTS, and prints final compile/link flags at configure time.

Written by Cursor Bugbot for commit dc45bbc. This will update automatically on new commits. Configure here.

@jit-ci
Copy link

jit-ci bot commented Feb 26, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new CMake option VECSIM_BUILD_TEST_HELPERS to provide finer control over the build process. The change separates the concerns of enabling test helper methods (like fitMemory and serialization) from building test executables.

Changes:

  • Added VECSIM_BUILD_TEST_HELPERS option to enable test helper methods without building test executables or fetching test frameworks
  • Modified BUILD_TESTS macro definition logic to activate when either VECSIM_BUILD_TEST_HELPERS or VECSIM_BUILD_TESTS is enabled
  • Updated VectorSimilaritySerializer library build condition to match the new logic

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
CMakeLists.txt Adds VECSIM_BUILD_TEST_HELPERS option and updates BUILD_TESTS macro definition logic to support both test helpers and test executables separately
src/VecSim/CMakeLists.txt Updates VectorSimilaritySerializer library build condition to include VECSIM_BUILD_TEST_HELPERS
Comments suppressed due to low confidence (1)

CMakeLists.txt:14

  • The comment states "Implies VECSIM_BUILD_TEST_HELPERS", but this implication is not explicitly enforced in the code. While the current logic works due to the OR condition in line 51, it would be more robust to explicitly set VECSIM_BUILD_TEST_HELPERS when VECSIM_BUILD_TESTS is ON. Consider adding: if(VECSIM_BUILD_TESTS) followed by set(VECSIM_BUILD_TEST_HELPERS ON) after the option declarations to make the dependency explicit and prevent potential confusion.
# VECSIM_BUILD_TESTS: Builds VectorSimilarity test executables (unit tests, benchmarks).
# Implies VECSIM_BUILD_TEST_HELPERS. Fetches googletest and google_benchmark.
option(VECSIM_BUILD_TESTS "Build VectorSimilarity test executables" ON)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dor-forer dor-forer marked this pull request as ready for review February 26, 2026 10:08
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.11%. Comparing base (805e876) to head (dc45bbc).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #913   +/-   ##
=======================================
  Coverage   97.11%   97.11%           
=======================================
  Files         129      129           
  Lines        7551     7551           
=======================================
  Hits         7333     7333           
  Misses        218      218           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dor-forer dor-forer enabled auto-merge February 26, 2026 11:51
@dor-forer dor-forer added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit 0924391 Feb 26, 2026
17 checks passed
@dor-forer dor-forer deleted the dorer-add-VECSIM_BUILD_TEST_HELPERS branch February 26, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants