Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

fleetctl: destroy fix and more tests #1439

Merged
merged 11 commits into from
Feb 24, 2016

Conversation

tixxdz
Copy link
Contributor

@tixxdz tixxdz commented Feb 24, 2016

fleetctl destroy fix and more tests. It contains a follow up fix for the race condition that was discussed in this merged PR: #1417

@tixxdz
Copy link
Contributor Author

tixxdz commented Feb 24, 2016

functional tests pass!

@@ -0,0 +1,148 @@
// Copyright 2014 CoreOS, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Date

@jonboulle
Copy link
Contributor

This looks fine at a high level but a few comments about the implementation. Looks like a fair amount of copy pasted code so hoping we can share that.

@tixxdz
Copy link
Contributor Author

tixxdz commented Feb 24, 2016

@jonboulle Updated and all comments handled, waiting to be green

@@ -26,6 +28,68 @@ import (
"github.com/coreos/fleet/Godeps/_workspace/src/github.com/coreos/go-semver/semver"
)

type commandTestResults struct {
Description string
Copy link
Contributor

Choose a reason for hiding this comment

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

these don't need to be exported

@jonboulle
Copy link
Contributor

Two more comments then LGTM

Djalal Harouni and others added 10 commits February 24, 2016 16:29
Just make it a const var that can be used or adapted if needed later.
Add IsErrorUnitNotFound() and use it in destroy to check if the error
indicates that the unit does not exist.

For the moment we just want to check if the error is 'unit not found', if
later we want more we may export a more generic function into cAPI.
…e conditions

Make the test more smarter by checking for race conditions and output
result. Sometimes you may see normal output sometimes no output between
the two goroutines which is normal, the thing to worry about is if
Destroy did success or not.
…mmands()

Add newFakeRegistryForCommands() function so fleetctl command tests can
use it. We will add stop and unload tests which will also use this
function and commandTestResults struct.
@tixxdz tixxdz force-pushed the tixxdz/fleet-destroy-and-tests-v1 branch from 6dcfa90 to 50c78c6 Compare February 24, 2016 15:43
tixxdz added a commit that referenced this pull request Feb 24, 2016
@tixxdz tixxdz merged commit d605dc0 into coreos:master Feb 24, 2016
@tixxdz tixxdz deleted the tixxdz/fleet-destroy-and-tests-v1 branch March 30, 2016 08:05
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants