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

Updated to support Marathon 0.9.1 with get_info() calls #59

Merged
merged 1 commit into from
Aug 18, 2015

Conversation

grampelberg
Copy link
Contributor

No description provided.

@solarkennedy
Copy link
Contributor

This PR seems a bit incomplete, did you add all the files?

@grampelberg
Copy link
Contributor Author

Nope, that's it. Is there something I should have done?

@solarkennedy
Copy link
Contributor

I expected references to get_info? Are the changes to support it just zookeeper timeout params?

Can you add support for 0.9.1 in the travis.yaml if it works?

@grampelberg
Copy link
Contributor Author

There were 5 keys added to the API between 0.9 and 0.9.1.

  • framework_name
  • leader_proxy_connection_timeout_ms
  • leader_proxy_read_timeout_ms
  • zk_max_versions
  • zk_session_timeout

These were all the changes required to get it working (API additions cause kwargs exceptions thrown).

(Now updated with the .travis.yml change)

@solarkennedy
Copy link
Contributor

This is good, but can you actually add testing coverage for this function that we are expanding? (like calling the get_info() function.

That way, when the api changes the next time, the integration tests will let us know right away as we attempt to support new versions.

@grampelberg
Copy link
Contributor Author

Oh yeah! Testing. That's a great idea. Let me add that.

@grampelberg
Copy link
Contributor Author

So, I couldn't get the tests to run locally (pkg_resources.DistributionNotFound: requests>=2.6.1,<2.7 when running make itests, any suggestions?). That said, it looks like that's the only change required.

@@ -19,6 +19,11 @@ def working_marathon(context):
context.client = marathon.MarathonClient(marathon_connection_string)


@then(u'we get the marathon instance\'s info')
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see this ever get called?
See itests/marathon_python.feature and start a new scenario for querying marathon in general

@solarkennedy
Copy link
Contributor

Yea it looks like tox installs requests 2.7 and docker compose needs <2.7.

I can't figure out how to make tox keep a version that docker compose likes.

I guess we could pin it <2.7 in setup.py, but I shouldn't have to do that.

Till then you can do

source .tox/itests/bin/activate
pip install requests==2.6.2
deactivate

to force a downgrade to something docker-compose can use.

@grampelberg
Copy link
Contributor Author

@solarkennedy That's what I get for not testing. Your workaround was perfect, test appears to be running and passing now!

@@ -2,6 +2,7 @@ Feature: marathon-python can create and list marathon apps

Scenario: Trivial apps can be deployed
Given a working marathon instance
Then we get the marathon instance's info

Choose a reason for hiding this comment

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

I think it would be more readable if this was a separate scenario (especially since this doesn't really have much to do with "Trivial apps can be deployed").

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes please. Plus once we have a place for that sort of thing we can add other general information gathering methods, (get_leader, get_metrics, ping, etc)

@grampelberg
Copy link
Contributor Author

Whoops, sorry about that. I've moved it into its own scenario now.

Scenario: Trivial apps can be deployed
Given a working marathon instance
Then we get the marathon instance's info
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove this now? It isn't really related to trivial apps and there is no need for us to exercise this twice

@grampelberg
Copy link
Contributor Author

That is stupidly embarrassing! Now removed.

:param str zk_state:
:param int zk_timeout:
"""

def __init__(self, zk=None, zk_future_timeout=None, zk_hosts=None, zk_path=None, zk_state=None, zk_timeout=None):
def __init__(self, zk=None, zk_future_timeout=None, zk_hosts=None, zk_max_versions=None,zk_path=None,

Choose a reason for hiding this comment

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

Sorry if I sound a bit anal, but do you mind adding a space between "zk_max_versions=None,zk_path=None"?

@grampelberg
Copy link
Contributor Author

And, updated again. I'm starting to wonder if I can actually write code =)

@solarkennedy
Copy link
Contributor

Thanks!

solarkennedy added a commit that referenced this pull request Aug 18, 2015
Updated to support Marathon 0.9.1 with get_info() calls
@solarkennedy solarkennedy merged commit 779e974 into thefactory:master Aug 18, 2015
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