Hi, sluk3r.
For single method such as set/get method, we use Lombok to generate. These code can miss unit test. But other methods should be full covered, if no particular reasons. For the method you print out. I think it should have a unit test, even use Mockito backendDataSource. In community document[1], you can see the `Covenant Unit Test of Conduct` [1] https://shardingsphere.apache.org/community/en/contribute/code-conduct/ -- Yi Yang(Sion) Apache ShardingSphere 在 2019-09-27 09:25:49,"王喜春" <[email protected]> 写道: >Hi, Sion Yang: > > >the method's whole implementation is: > > >public Map<String, YamlDataSourceParameter> getDataSources() { > return backendDataSource.getDataSourceParameters(); >} >there is just a single return statement, intuitively, I think there is little >necessary to unit test this method. Or this type of problem has been >discussed, and agreement has been achieved? give me a point, pls. >Tks > > > > >------------------ 原始邮件 ------------------ >发件人: "Sion Yang"<[email protected]>; >发送时间: 2019年9月27日(星期五) 上午8:51 >收件人: "dev"<[email protected]>; > >主题: Re:config rules to exclude some unnecessary code for unit codecoverage? > > > >Hi, sluk3r. > > >How to judge these codes are unnecessary or little necessary? > > > > >-- > >Yi Yang(Sion) >Apache ShardingSphere > > >At 2019-09-27 05:40:16, "王喜春" <[email protected]> wrote: > >Hi, for example, the code shown in the following pic, method of >getDataSources return "backendDataSource.getDataSourceParameters()" directly. >the full url is : >https://coveralls.io/builds/25937232/source?filename=sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/LogicSchema.java > > > > >it seems that there is little necessary for some code. > > >So I'd like to know, is there some standard for unit code coverage rate? if >so, has this coverage rate been configured into some file? > > > > >Tks.
