Skip to content

Commit

Permalink
CBL-5786 : Download VS Search in CI Build for testing
Browse files Browse the repository at this point in the history
* Downloaded VS Search in CI Build for testing.
* Disabled VS Search on Windows ARM64 for now as we don’t release it in 3.2.0 beta-3.
  • Loading branch information
pasin committed May 23, 2024
1 parent 3795baf commit 04088f2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
11 changes: 11 additions & 0 deletions jenkins/ci_build_unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ echo VERSION=${VERSION}

ln -sf ${WORKSPACE}/couchbase-lite-c-ee/couchbase-lite-core-EE ${WORKSPACE}/couchbase-lite-c/vendor/couchbase-lite-core-EE

if [[ ${EDITION} == 'enterprise'* ]]; then
echo "==== Download Vector Search Extension for Tests ==="
pushd ${project_dir}
if [[ $OSTYPE == 'darwin'* ]]; then
./scripts/download_vector_search_extension.sh apple
else
./scripts/download_vector_search_extension.sh linux
fi
popd
fi

echo "==== Building macos/linux Release binary ==="
cd ${WORKSPACE}/build_release
cmake -DEDITION=${EDITION} -DCMAKE_INSTALL_PREFIX=`pwd`/libcblite-$VERSION -DCMAKE_BUILD_TYPE=MinSizeRel ..
Expand Down
14 changes: 13 additions & 1 deletion jenkins/ci_build_win_desktop.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ function Build() {
Pop-Location
}

function DownloadVectorSearchExtension() {
Push-Location ${env:WORKSPACE}\couchbase-lite-c
& .\scripts\download_vector_search_extension.ps1
Pop-Location
}

function Run-UnitTest() {
param(
[Parameter(Mandatory=$true, Position = 0)][string]$directory
Expand All @@ -93,8 +99,14 @@ function Run-UnitTest() {
$Build_Dir = "build_${Architecture}"
Remove-Item -Recurse -Force -ErrorAction Ignore "${env:WORKSPACE}\${Build_Dir}\libcblite-${Version}"
New-Item -Type Junction -Target ${env:WORKSPACE}/couchbase-lite-c-ee/couchbase-lite-core-EE -Path ${env:WORKSPACE}/couchbase-lite-c/vendor/couchbase-lite-core-EE

if ("${Edition}" -eq "enterprise") {
DownloadVectorSearchExtension
}

Build "${env:WORKSPACE}\${Build_Dir}"
if("${Edition}" -eq "enterprise") {

if ("${Edition}" -eq "enterprise") {
Run-UnitTest "${env:WORKSPACE}\${Build_Dir}"
}

Expand Down
8 changes: 7 additions & 1 deletion test/VectorSearchTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ using namespace std;

#ifdef COUCHBASE_ENTERPRISE

#if defined(__APPLE__) || defined(__linux__) || defined(WIN32)
#if defined(__APPLE__) || defined(__linux__)
#define VECTOR_SEARCH_TEST_ENABLED 1
#endif

#if defined(WIN32)
#if defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || defined(_M_X64)
#define VECTOR_SEARCH_TEST_ENABLED 1
#endif
#endif

#ifdef VECTOR_SEARCH_TEST_ENABLED

static vector<string> sVectorSearchTestLogs;
Expand Down

0 comments on commit 04088f2

Please sign in to comment.