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

pkg/{canary,controller}: remove unused skipLivenessChecks #530

Merged
merged 1 commit into from
Mar 28, 2020

Conversation

mathetake
Copy link
Collaborator

@mathetake mathetake commented Mar 28, 2020

I realized that skipLivenessChecks bool (which equals to job.SkipTests) has been always set to be false and it's not necessary.

So this PR deleted it and fixed tests accordingly


P.S. I think we'd better use gomock of canary.Controller and mesh.Router interface in order to simplify tests in controller package. Currently they are like small e2e tests and deeply connected with internal implementations of these interfaces, which make it harder for developers who want to contribute to Flagger to understand the internal functionality.

@mathetake mathetake requested a review from stefanprodan as a code owner March 28, 2020 07:28
@codecov-io
Copy link

Codecov Report

Merging #530 into master will increase coverage by 0.19%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #530      +/-   ##
==========================================
+ Coverage   50.31%   50.50%   +0.19%     
==========================================
  Files          63       63              
  Lines        4941     4938       -3     
==========================================
+ Hits         2486     2494       +8     
+ Misses       2044     2034      -10     
+ Partials      411      410       -1     
Impacted Files Coverage Δ
pkg/canary/service_controller.go 0.00% <0.00%> (ø)
pkg/controller/job.go 0.00% <0.00%> (ø)
pkg/canary/daemonset_controller.go 60.00% <33.33%> (+0.35%) ⬆️
pkg/controller/scheduler.go 47.30% <57.14%> (+1.33%) ⬆️
pkg/canary/deployment_controller.go 63.07% <100.00%> (+1.00%) ⬆️
pkg/canary/deployment_ready.go 38.18% <0.00%> (+1.81%) ⬆️

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 9c46be1...f67f846. Read the comment docs.

err = c.createPrimaryDaemonSet(cd)
if err != nil {
return fmt.Errorf("createPrimaryDaemonSet failed: %w", err)
}

if cd.Status.Phase == "" || cd.Status.Phase == flaggerv1.CanaryPhaseInitializing {
if !skipLivenessChecks && !cd.SkipAnalysis() {
Copy link
Member

Choose a reason for hiding this comment

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

Removing the SkipAnalysis condition changes the current behaviour. Is this intentional? if so please add a separate commit with it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I misunderstood this condition - this is not intentional so I am going to revert this change

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

force pushed the reverted version

@mathetake mathetake force-pushed the remove-skipLivenessChecks-param branch from f67f846 to 65d4b28 Compare March 28, 2020 09:13
@stefanprodan
Copy link
Member

stefanprodan commented Mar 28, 2020

I think we'd better use gomock of canary.Controller and mesh.Router interface in order to simplify tests in controller package.

Yes that would be a great improvement to tests readability 👍

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @mathetake 🎖

@mathetake mathetake merged commit 7676918 into master Mar 28, 2020
@mathetake mathetake deleted the remove-skipLivenessChecks-param branch March 28, 2020 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants