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

[Refactor] Move pollDeploymentStatus to resource.Deployment.CheckStatus #2896

Merged
merged 2 commits into from
Sep 18, 2019

Conversation

tejal29
Copy link
Contributor

@tejal29 tejal29 commented Sep 17, 2019

Relates to #176
Fixes #2744
(Moved the test to use mockResources instead of deployments. Does not test the loop and always returns in first try)

Should merge before :

Description

In this PR,

  • Move pollDeploymentStatus to resource.Deployment.CheckStatus
  • Add a new interface Resource which will be implemented by Pod and later.
    Current it is used for mocking Deployment in pollResourceStatus
    test.
  • Add a concept of retry and non-retry errors.

Output Changes

n/a

Before

n/a

After

n/a

Next PRs.

next changes for #176,

  • Introduce a resource.Base and move all common functions for pod and deployment there.
  • Add Pod deployment checks
  • Add events for IDE to consume the check

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Mentions any output changes.

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

  • The code flow looks good.
  • Unit test added.
  • User facing document changes look good.

@@ -322,52 +323,6 @@ func TestGetDeployStatus(t *testing.T) {
}
}

func TestGetRollOutStatus(t *testing.T) {
rolloutCmd := "kubectl --context kubecontext --namespace test rollout status deployment dep --watch=false"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to TestCheckStatus in deployment_test.go

@tejal29 tejal29 changed the title Move pollDeploymentStatus to resource.Deployment.CheckStatus [Refactor] Move pollDeploymentStatus to resource.Deployment.CheckStatus Sep 17, 2019
@codecov
Copy link

codecov bot commented Sep 17, 2019

Codecov Report

Merging #2896 into master will decrease coverage by 0.1%.
The diff coverage is 96.42%.

Impacted Files Coverage Δ
pkg/skaffold/deploy/resource/deployment.go 91.11% <100%> (-8.89%) ⬇️
pkg/skaffold/deploy/status_check.go 56.48% <87.5%> (-2.65%) ⬇️
pkg/skaffold/build/custom/custom.go 63.93% <0%> (-1.86%) ⬇️
pkg/skaffold/initializer/init.go 57.45% <0%> (-1.69%) ⬇️

@tejal29 tejal29 force-pushed the move_poll_deployment branch from 7aa6dbd to 3c57370 Compare September 17, 2019 08:25
In this PR,
- Move pollDeploymentStatus to resource.Deployment.CheckStatus
- Add a new interface `Resource` which will be implemented by `Pod` and later.
  Current it is used for mocking `Deployment` in `pollResourceStatus`
  test.
- Add a concept of retry and non-retry errors.
@tejal29 tejal29 force-pushed the move_poll_deployment branch from 3c57370 to a7a1093 Compare September 17, 2019 08:26
Copy link
Contributor

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

This looks really good to me! Just one suggestion.

pkg/skaffold/deploy/resource/deployment.go Outdated Show resolved Hide resolved
@tejal29 tejal29 merged commit 0bb1a19 into GoogleContainerTools:master Sep 18, 2019
@tejal29 tejal29 deleted the move_poll_deployment branch September 18, 2019 20:37
tejal29 added a commit to tejal29/skaffold that referenced this pull request Sep 18, 2019
…e_poll_deployment"

This reverts commit 0bb1a19, reversing
changes made to 6fe628f.
tejal29 added a commit to tejal29/skaffold that referenced this pull request Sep 18, 2019
…al29/move_poll_deployment""

This reverts commit cf878dc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestPollDeploymentRolloutStatus is unstable
3 participants