mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
Related to #45105 This commit refactors the test MilvusClient wrapper to leverage Go's embedding pattern and improves test organization with subtests. **File**: `tests/go_client/base/milvus_client.go` - **Use `typeutil.NewSet` for rate limiting**: Replace map-based `rateLogMethods` with `typeutil.NewSet` for cleaner and more efficient membership checking - **Embed `*client.Client` directly**: Change `MilvusClient` structure from wrapping the client as a field to embedding it directly - **Remove ~380 lines of wrapper methods**: All wrapper methods (database, collection, partition, index, read/write, RBAC, etc.) are now unnecessary thanks to Go's embedding feature, which automatically promotes embedded methods to the outer type - **Simplify initialization**: Update `NewMilvusClient` and `Close` to use embedded client directly - **Fix typo**: Correct comment "Ike the actual method" → "Invoke the actual method" **File**: `tests/go_client/testcases/search_test.go` - **Wrap assertions in subtests**: Each search expression test is now wrapped in `t.Run()` with descriptive names - **Dynamic subtest naming**: Format: `expr={expression}_dynamic-{true/false}` for clear test identification Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>