You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by "Adam Antal (Jira)" <ji...@apache.org> on 2020/06/05 05:56:00 UTC

[jira] [Commented] (YUNIKORN-207) Improve unit testing coverage

    [ https://issues.apache.org/jira/browse/YUNIKORN-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17126414#comment-17126414 ] 

Adam Antal commented on YUNIKORN-207:
-------------------------------------

Thanks for bringing this up [~wwei].
This is the current situation in yunikorn-core:
{noformat}
go test ./... -race -tags deadlock -coverprofile=coverage.txt -covermode=atomic
?   	github.com/apache/incubator-yunikorn-core/cmd/schedulerclient	[no test files]
?   	github.com/apache/incubator-yunikorn-core/cmd/simplescheduler	[no test files]
?   	github.com/apache/incubator-yunikorn-core/pkg/api	[no test files]
ok  	github.com/apache/incubator-yunikorn-core/pkg/cache	2.852s	coverage: 61.3% of statements
?   	github.com/apache/incubator-yunikorn-core/pkg/cache/cacheevent	[no test files]
ok  	github.com/apache/incubator-yunikorn-core/pkg/common	1.574s	coverage: 28.1% of statements
?   	github.com/apache/incubator-yunikorn-core/pkg/common/commonevents	[no test files]
ok  	github.com/apache/incubator-yunikorn-core/pkg/common/configs	6.619s	coverage: 90.4% of statements
ok  	github.com/apache/incubator-yunikorn-core/pkg/common/resources	2.607s	coverage: 97.7% of statements
ok  	github.com/apache/incubator-yunikorn-core/pkg/common/security	2.430s	coverage: 86.6% of statements
?   	github.com/apache/incubator-yunikorn-core/pkg/entrypoint	[no test files]
?   	github.com/apache/incubator-yunikorn-core/pkg/examples	[no test files]
?   	github.com/apache/incubator-yunikorn-core/pkg/handler	[no test files]
ok  	github.com/apache/incubator-yunikorn-core/pkg/log	1.353s	coverage: 76.5% of statements
ok  	github.com/apache/incubator-yunikorn-core/pkg/metrics	3.228s	coverage: 42.9% of statements
ok  	github.com/apache/incubator-yunikorn-core/pkg/metrics/history	1.264s	coverage: 100.0% of statements
?   	github.com/apache/incubator-yunikorn-core/pkg/plugins	[no test files]
?   	github.com/apache/incubator-yunikorn-core/pkg/rmproxy	[no test files]
?   	github.com/apache/incubator-yunikorn-core/pkg/rmproxy/rmevent	[no test files]
ok  	github.com/apache/incubator-yunikorn-core/pkg/scheduler	2.471s	coverage: 49.8% of statements
ok  	github.com/apache/incubator-yunikorn-core/pkg/scheduler/placement	2.433s	coverage: 88.3% of statements
ok  	github.com/apache/incubator-yunikorn-core/pkg/scheduler/policies	2.301s	coverage: 100.0% of statements
?   	github.com/apache/incubator-yunikorn-core/pkg/scheduler/schedulerevent	[no test files]
ok  	github.com/apache/incubator-yunikorn-core/pkg/scheduler/tests	46.358s	coverage: 91.6% of statements
ok  	github.com/apache/incubator-yunikorn-core/pkg/webservice	2.660s	coverage: 26.9% of statements
?   	github.com/apache/incubator-yunikorn-core/pkg/webservice/dao	[no test files]
{noformat}
and the shim:
{noformat}
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/appmgmt	6.736s	coverage: 54.7% of statements
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/appmgmt/general	2.789s	coverage: 50.0% of statements
?   	github.com/apache/incubator-yunikorn-k8shim/pkg/appmgmt/interfaces	[no test files]
?   	github.com/apache/incubator-yunikorn-k8shim/pkg/appmgmt/sparkoperator	[no test files]
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/cache	17.036s	coverage: 44.3% of statements
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/cache/external	2.763s	coverage: 29.8% of statements
?   	github.com/apache/incubator-yunikorn-k8shim/pkg/callback	[no test files]
?   	github.com/apache/incubator-yunikorn-k8shim/pkg/client	[no test files]
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/common	2.750s	coverage: 83.0% of statements
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/common/events	3.862s	coverage: 21.1% of statements
?   	github.com/apache/incubator-yunikorn-k8shim/pkg/common/test	[no test files]
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/common/utils	2.026s	coverage: 18.5% of statements
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/conf	1.842s	coverage: 50.0% of statements
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/dispatcher	11.696s	coverage: 91.3% of statements
?   	github.com/apache/incubator-yunikorn-k8shim/pkg/log	[no test files]
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/plugin/admissioncontrollers/webhook	3.760s	coverage: 21.4% of statements
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/plugin/predicates	2.802s	coverage: 86.6% of statements
ok  	github.com/apache/incubator-yunikorn-k8shim/pkg/shim	23.007s	coverage: 76.1% of statements
{noformat}

We can file jiras based on this list targeting the packages with the smallest coverage percent.

> Improve unit testing coverage
> -----------------------------
>
>                 Key: YUNIKORN-207
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-207
>             Project: Apache YuniKorn
>          Issue Type: Improvement
>          Components: core - cache, core - common, core - scheduler, shim - kubernetes, webapp
>            Reporter: Weiwei Yang
>            Priority: Major
>
> Pls take a look at [SpaceX lessons learned|[https://lwn.net/Articles/540368/?from=groupmessage&isappinstalled=0]]
> {quote}
> Automation is important, and continuous integration is "very valuable", Rose said. He suggested building for every platform all of the time, even for "things you don't use any more". SpaceX does that and has found interesting problems when building unused code. Unit tests are run from the continuous integration system any time the code changes. "Everyone here has 100% unit test coverage", he joked, but running whatever tests are available, and creating new ones is useful.
> {quote}
> we should learn from how to build a rocket :)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: issues-help@yunikorn.apache.org