Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit test in controllers/timechaos #314

Merged
merged 12 commits into from Mar 10, 2020

Conversation

oraluben
Copy link
Contributor

@oraluben oraluben commented Mar 5, 2020

UCP #265

What problem does this PR solve?

#265

What is changed and how does it work?

Check List

Tests

  • Unit test

Code changes

  • Has Go code change

Side effects

Related changes

Does this PR introduce a user-facing change?:

NONE

@sre-bot
Copy link
Contributor

sre-bot commented Mar 5, 2020

Thanks for your contribution. If your PR get merged, you will be rewarded 50 points.

@oraluben
Copy link
Contributor Author

oraluben commented Mar 5, 2020

@fewdan PLTA if the overall structure is ok, mainly about how MockChaosDaemonClient works.
https://github.com/pingcap/chaos-mesh/pull/314/files#diff-0fb24aea9516170aab0542b352b676c7L235-R274

@fewdan
Copy link
Member

fewdan commented Mar 6, 2020

@oraluben Thank you for your contribution. I think your structure is fine.

@oraluben
Copy link
Contributor Author

oraluben commented Mar 8, 2020

/test

@oraluben
Copy link
Contributor Author

oraluben commented Mar 8, 2020

@fewdan PTAL

@oraluben oraluben changed the title [ WIP ] Add Unit test in controllers/timechaos Add Unit test in controllers/timechaos Mar 8, 2020
@zhouqiang-cl
Copy link
Contributor

/test

@codecov-io
Copy link

codecov-io commented Mar 8, 2020

Codecov Report

Merging #314 into master will decrease coverage by 1.61%.
The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #314      +/-   ##
==========================================
- Coverage   60.34%   58.72%   -1.62%     
==========================================
  Files          44       44              
  Lines        2890     2704     -186     
==========================================
- Hits         1744     1588     -156     
+ Misses       1026     1003      -23     
+ Partials      120      113       -7
Impacted Files Coverage Δ
pkg/utils/selector.go 51.65% <0%> (-8.12%) ⬇️
pkg/utils/chaosdaemon.go 0% <0%> (ø) ⬆️
controllers/timechaos/types.go 58.46% <100%> (ø) ⬆️
pkg/chaosdaemon/util.go 76.25% <0%> (-6.19%) ⬇️
pkg/chaosdaemon/time_server.go 100% <0%> (+5.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e21756...0ef90d7. Read the comment docs.

@cwen0 cwen0 added this to PR: In Progress in Challenge Program Mar 9, 2020
@zhouqiang-cl
Copy link
Contributor

@lucklove PTAL too

Copy link
Contributor

@lucklove lucklove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@cwen0 cwen0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cwen0
Copy link
Member

cwen0 commented Mar 10, 2020

/merge

conn *grpc.ClientConn
}

func (c *GrpcChaosDaemonClient) Close() error {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method GrpcChaosDaemonClient.Close should have comment or be unexported

conn *grpc.ClientConn
}

func (c *GrpcChaosDaemonClient) Close() error {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method GrpcChaosDaemonClient.Close should have comment or be unexported

return nil, mockError("ContainerKill")
}

func (c *MockChaosDaemonClient) Close() error {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method MockChaosDaemonClient.Close should have comment or be unexported

@sre-bot
Copy link
Contributor

sre-bot commented Mar 10, 2020

/run-all-tests

@cwen0 cwen0 merged commit d60ea18 into chaos-mesh:master Mar 10, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 10, 2020

Team oraluben complete task #265 and get 50 score, currerent score 100

@oraluben oraluben deleted the controller-UTs branch March 13, 2020 00:39
@cwen0 cwen0 moved this from PR: In Progress to PR: DONE in Challenge Program Mar 17, 2020
sjwsl pushed a commit to sjwsl/chaos-mesh that referenced this pull request May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

7 participants