Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

add yurtingress controller unit test #85

Merged
merged 2 commits into from
Aug 4, 2022

Conversation

rudolf-chy
Copy link
Contributor

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage
/sig storage

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

@zzguang
Copy link
Member

zzguang commented Aug 2, 2022

@Rudolf1998 , the current unit test coverage is only about 18.8% basing on your PR, which can not meet the 70% target, could you please optimize it to improve the ratio? thanks!
$go test ./pkg/yurtappmanager/controller/yurtingress/... --covermode=count
ok github.com/openyurtio/yurt-app-manager/pkg/yurtappmanager/controller/yurtingress (cached) coverage: 18.8% of statements

@kadisi
Copy link
Member

kadisi commented Aug 2, 2022

@Rudolf1998 , the current unit test coverage is only about 18.8% basing on your PR, which can not meet the 70% target, could you please optimize it to improve the ratio? thanks! $go test ./pkg/yurtappmanager/controller/yurtingress/... --covermode=count ok github.com/openyurtio/yurt-app-manager/pkg/yurtappmanager/controller/yurtingress (cached) coverage: 18.8% of statements

@zzguang I think 70% test coverage for the entire yurt-app-manager repo is enough, and some unit tests will need mock tests, which we can implement uniformly later.

@zzguang
Copy link
Member

zzguang commented Aug 2, 2022

@Rudolf1998 , the current unit test coverage is only about 18.8% basing on your PR, which can not meet the 70% target, could you please optimize it to improve the ratio? thanks! $go test ./pkg/yurtappmanager/controller/yurtingress/... --covermode=count ok github.com/openyurtio/yurt-app-manager/pkg/yurtappmanager/controller/yurtingress (cached) coverage: 18.8% of statements

@zzguang I think 70% test coverage for the entire yurt-app-manager repo is enough, and some unit tests will need mock tests, which we can implement uniformly later.

Okay, agree with you to implement the mock test in future.

@kadisi
Copy link
Member

kadisi commented Aug 2, 2022

/approve

@openyurt-bot openyurt-bot added the approved approved label Aug 2, 2022
@zzguang
Copy link
Member

zzguang commented Aug 2, 2022

/lgtm

@openyurtio openyurtio deleted a comment from openyurt-bot Aug 2, 2022
@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #85 (12f13bc) into master (4fd0202) will increase coverage by 1.55%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           master     #85      +/-   ##
=========================================
+ Coverage    7.78%   9.34%   +1.55%     
=========================================
  Files          17      18       +1     
  Lines        1901    2258     +357     
=========================================
+ Hits          148     211      +63     
- Misses       1724    2010     +286     
- Partials       29      37       +8     
Flag Coverage Δ
unittests 9.34% <ø> (+1.55%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...r/controller/yurtingress/yurtingress_controller.go 17.64% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@kadisi
Copy link
Member

kadisi commented Aug 2, 2022

@Rudolf1998 please check ci/golangci-lint error info .

@openyurt-bot openyurt-bot removed the lgtm lgtm label Aug 2, 2022
@zzguang
Copy link
Member

zzguang commented Aug 2, 2022

/lgtm

@openyurt-bot openyurt-bot added the lgtm lgtm label Aug 2, 2022
@Congrool
Copy link
Member

Congrool commented Aug 3, 2022

Fixes #76

@zzguang
Copy link
Member

zzguang commented Aug 4, 2022

/approve

@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kadisi, Rudolf1998, zzguang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zzguang zzguang merged commit 23956e8 into openyurtio:master Aug 4, 2022
@rudolf-chy rudolf-chy deleted the yurtingress_ut branch August 22, 2022 10:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants