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

daisy: Add StopStep #397

Merged
merged 8 commits into from
May 22, 2018
Merged

Conversation

helen-fornazier
Copy link
Contributor

Step to stop an instance without deleting it.
The StopStep is similar to DeleteResources for instances, but allow
adding WaitForInstanceSignal without making it a dependency to the
Delete step.

Depend on #396

@zmarano
Copy link
Contributor

zmarano commented May 4, 2018

/ok-to-test

@zmarano zmarano requested a review from adjackura May 4, 2018 23:14
@zmarano zmarano assigned zmarano and adjackura and unassigned zmarano May 4, 2018
@codecov
Copy link

codecov bot commented May 4, 2018

Codecov Report

Merging #397 into master will increase coverage by 0.26%.
The diff coverage is 89.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #397      +/-   ##
==========================================
+ Coverage    74.6%   74.86%   +0.26%     
==========================================
  Files          33       34       +1     
  Lines        3390     3449      +59     
==========================================
+ Hits         2529     2582      +53     
- Misses        683      687       +4     
- Partials      178      180       +2
Flag Coverage Δ
#go_unittests 74.86% <89.83%> (+0.26%) ⬆️
Impacted Files Coverage Δ
daisy/resource.go 86.44% <ø> (ø) ⬆️
daisy/compute/compute.go 73.62% <100%> (+0.38%) ⬆️
daisy/compute/test_client.go 98.57% <100%> (+0.04%) ⬆️
daisy/step.go 78.12% <100%> (+0.52%) ⬆️
daisy/resource_registry.go 96.39% <100%> (+0.35%) ⬆️
daisy/instance.go 84.13% <71.42%> (-0.45%) ⬇️
daisy/step_stop_instances.go 86.66% <86.66%> (ø)

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 395830c...65d7a2e. Read the comment docs.

defer wg.Done()
w.Logger.StepInfo(w, "StopInstances", "stopping instance %q.", i)
if err := w.instances.stop(i); err != nil {
if err.Type() == resourceDNEError {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should never happen, just go ahead and remove the resourceDNEError check and log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

shouldn't we validate if we are trying to stop a machine that doesn't exist?
If I remove here, I also need to remote the test case where we try to stop a machine we didn't created.

@@ -39,6 +39,7 @@ type Client interface {
DeleteDisk(project, zone, name string) error
DeleteImage(project, name string) error
DeleteInstance(project, zone, name string) error
StopInstance(project, zone, name string) error
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll also need to add the test implementation to test_client, thats probably why the tests are failing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, could you check please?

@@ -48,6 +48,7 @@ type Step struct {
CreateInstances *CreateInstances `json:",omitempty"`
CreateNetworks *CreateNetworks `json:",omitempty"`
CopyGCSObjects *CopyGCSObjects `json:",omitempty"`
StopInstances *StopInstances `json:",omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you also need startinstances? If you don't need it for you tests there's no need to add it now, though we proabbly should make an issue to track it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't need startinstances for my tests, I'll make an issue then

@helen-fornazier
Copy link
Contributor Author

sorry, codecov wasn't configured in my repo, I'll fix those checks and update the PR

Step to stop an instance without deleting it.
The StopStep is similar to DeleteResources for instances, but allow
adding WaitForInstanceSignal without making it a dependency to the
Delete step.
@daisy-bot
Copy link

daisy-bot commented May 16, 2018

@helen-fornazier: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/presubmit/flake8 5604121 link /flake8

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@adjackura adjackura merged commit b98b6d9 into GoogleCloudPlatform:master May 22, 2018
@helen-fornazier helen-fornazier deleted the stop-step branch May 22, 2018 20:50
gaohannk pushed a commit to gaohannk/compute-image-tools that referenced this pull request May 20, 2021
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.

None yet

4 participants