-
Notifications
You must be signed in to change notification settings - Fork 36
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
Conversation
|
||
type controllerSuite struct { | ||
testing.CleanupSuite | ||
server *SimpleTestServer |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
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...
…us to StatusName and add StatusMessage.
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi |
Build failed: Tests failed |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi |
Build failed: Tests failed |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi |
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.