Aetherance opened a new pull request, #3126: URL: https://github.com/apache/dubbo-go/pull/3126
### Description add unit tests for registry and proxy ``` proxy/ ├── proxy_factory │ ├── default.go # 核心逻辑已通过新增测试间接覆盖 (Invoke, getProviderURL, 工厂创建) 覆盖率 11.3%→69.5% │ ├── pass_through.go # 核心逻辑已通过新增测试间接覆盖 (参数校验失败与透传路径) │ ├── utils.go # 核心逻辑已通过新增测试间接覆盖 (callLocalMethod 成功与 panic 分支) │ ├── invoker_test.go # 新增测试文件 │ └── utils_test.go # 新增测试文件 ├── proxy_factory.go # 维持原状 (逻辑简单,已有间接覆盖) ├── proxy.go # 维持原状 (已有测试覆盖主要实现) 覆盖率保持 80.0% └── proxy_test.go # 维持原状 (测试文件已存在) registry/ ├── base_configuration_listener.go # 核心逻辑已通过新增测试间接覆盖 (OverrideUrl/ToConfigurators) 覆盖率 1.9%→21.1% ├── base_configuration_listener_test.go # 新增测试文件 ├── base_registry.go # 维持原状 (依赖 FacadeBasedRegistry、网络请求、并发循环,mock 成本高且收益低) ├── directory/ # 维持原状 (目录内所有文件均依赖 Registry/网络逻辑) ├── etcdv3/ # 维持原状 (目录内所有文件均依赖 etcd 集群环境) ├── event_test.go # 维持原状 (涉及事件广播/回调,依赖外部 listener) ├── nacos/ # 维持原状 (目录内所有文件均依赖 Nacos 注册中心环境) ├── options.go # 核心逻辑已通过新增测试间接覆盖 (defaultOptions/NewOptions/WithEtcdV3/WithZookeeper/WithID/WithTimeout/WithAddress) ├── options_test.go # 新增测试文件 ├── protocol/ # 维持原状 (目录内所有文件均涉及协议实现和网络交互) ├── servicediscovery/ # 维持原状 (目录内所有文件均依赖真实 ServiceInfo/注册中心/缓存/REST 等环境) ├── service_instance.go # 核心逻辑已通过新增测试间接覆盖 (GetAddress/ToURLs/Copy/GetWeight, GetEndPoints 88.9%) ├── service_instance_test.go # 新增测试文件 └── zookeeper/ # 维持原状 (目录内所有文件均依赖 Zookeeper 注册中心环境) ``` ### Checklist - [x] I confirm the target branch is `develop` - [x] Code has passed local testing - [x] I have added tests that prove my fix is effective or that my feature works -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
