congqixia 511a04a6a5
enhance: Refactor go_client test wrapper to use embedding and improve test structure (#45113)
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>
2025-10-28 16:16:10 +08:00
..