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

Controller interface #12

Merged
merged 10 commits into from
Mar 30, 2016
Merged

Controller interface #12

merged 10 commits into from
Mar 30, 2016

Conversation

howbazaar
Copy link
Contributor

Introduce the concepts of interfaces to gomaasapi.

Add Controller, Zone and Machine interfaces.

The machine listing from the controller doesn't yet honour the params, but instead just lists all of them.


type controllerSuite struct {
testing.CleanupSuite
server *SimpleTestServer

Choose a reason for hiding this comment

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

I'd really like to see a shim that allows us to inject JSON responses into the API layer, so we can test without an http server - both here and in juju. To use it in juju it would need to be exposed publicly, which means it would need to not be a gross hack. It can be very basic - just mapping endpoints to a sequence of pre-canned responses. It's how we integrate and expose it that needs thought.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think that would be a good idea. I'd like to get a few more parts in place first, and deal with the first PUT and POST calls before the shim design is likely to drop out.

@voidspace
Copy link

A couple of minor comments, one philosophical difference around version, and a wish for response injection for testing (can be added later). Other than that LGTM.

return server
}

func (s *SimpleTestServer) addResponse(path string, status int, body string) {

Choose a reason for hiding this comment

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

Could we make this public so we can use the test server from juju?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

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 do feel though that this testing simple server should end up in the testing repository not gomaasapi publicly but later...

@howbazaar
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Contributor

jujubot commented Mar 30, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi

@jujubot
Copy link
Contributor

jujubot commented Mar 30, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi/14

@howbazaar
Copy link
Contributor Author

$$try-now$$

@jujubot
Copy link
Contributor

jujubot commented Mar 30, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi

@jujubot
Copy link
Contributor

jujubot commented Mar 30, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi/15

@howbazaar
Copy link
Contributor Author

$$more-deps$$

@jujubot
Copy link
Contributor

jujubot commented Mar 30, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi

@jujubot jujubot merged commit accc3f0 into juju:master Mar 30, 2016
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