Files
milvus/scripts/build_cmek_fixtures.sh
XuanYang-cn 720983fe5d test: add Scalar Index CMEK positive matrix (#52816)
## Summary

- Add the positive Scalar Index CMEK matrix for engines 2, 3, and 5
across V2/V3 artifact formats.
- Cover 17 cells with repository-owned Go/C++ CipherPlugin fixtures,
authoritative object locators, independent V2/V3 envelope inspectors,
release/load checks, and type-specific query oracles.
- Verify database EZ ID inheritance and configured root-key material
propagation: the strict fixtures now fail when an EZ key was not
delivered, and the C++ fixture derives encryption keys from the exact
forwarded root key.
- Keep vector-index setup in every collection with an explicit FLAT/L2
index.
- Keep `integration-test` as the aggregate CI gate: it depends on the
existing non-CMEK scope and the dedicated CMEK scope, while only the
CMEK target builds its fixture plugins.
- Group the campaign tests by suite in the V2, V3, and FMINDEX suite
files.

## Review follow-up

- Complete the ASF license headers in all new source and CMake files.
- Remove the unused text-log inspector wrapper.
- Link the independent V3 inspector to the format design and production
reader/writer sources to make drift reviewable without coupling the
oracle to production decoding.
- Keep large V2 EZ ID parsing local to the inspector with json.Number;
this PR does not modify production descriptor decoding.
- Split the default integration gate into `integration-test-base` and
`integration-test-cmek`, exclude only the top-level CMEK package from
the base run, and append CMEK coverage to the same `it_coverage.txt`
only when invoked through the aggregate target.

## Verification

- Controlled full Milvus build — passed after merging current master.
- `make integration-test-cmek` — 23 tests passed in 3m02s.
- CMEK fixture build regression — passed.
- Target graph dry-run — the aggregate runs base before CMEK with append
enabled, while standalone CMEK resets the single coverage file.
- Strict Go fixture unit test — passed after reproducing the fallback
gap.
- Scoped V2/V3 inspector tests — passed.
- `make fmt` — passed.
- Controlled static-check — 0 issues in core, pkg, client, and
go_client.
- All commits are signed off.

issue: #52815

---------

Signed-off-by: yangxuan <[email protected]>
2026-09-03 01:25:29 +08:00

67 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Licensed to the LF AI & Data foundation under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -euo pipefail
script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
repo_root=$(cd -- "$script_dir/.." && pwd)
output_dir=${1:-"$repo_root/bin/cmek-fixtures"}
cpp_build_dir="$repo_root/cmake_build/cmek-fixtures"
go_command=${GO:-go}
build_jobs=${jobs:-2}
mkdir -p "$output_dir"
output_dir=$(cd -- "$output_dir" && pwd)
mkdir -p "$cpp_build_dir"
cd "$repo_root"
"$go_command" build \
-buildmode=plugin \
-buildvcs=false \
-tags dynamic,test \
-o "$output_dir/libGoCipherPlugin.so" \
./tests/integration/cmek/pluginmock/go
"$go_command" build \
-race \
-buildmode=plugin \
-buildvcs=false \
-tags dynamic,test \
-gcflags "all=-N -l" \
-o "$output_dir/libGoCipherPluginRace.so" \
./tests/integration/cmek/pluginmock/go
cmake \
-S "$repo_root/tests/integration/cmek/pluginmock/cpp" \
-B "$cpp_build_dir" \
-DMILVUS_SOURCE_DIR="$repo_root" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY="$output_dir"
cmake --build "$cpp_build_dir" --parallel "$build_jobs"
"$cpp_build_dir/CipherPluginTest"
for artifact in \
"$output_dir/libGoCipherPlugin.so" \
"$output_dir/libGoCipherPluginRace.so" \
"$output_dir/libCipherPlugin.so"; do
if [ ! -s "$artifact" ]; then
echo "CMEK fixture build did not produce $artifact" >&2
exit 1
fi
done