Skip to content

First pass at adding an itest framework#42

Merged
solarkennedy merged 1 commit intothefactory:masterfrom
solarkennedy:itest_framework
Jul 10, 2015
Merged

First pass at adding an itest framework#42
solarkennedy merged 1 commit intothefactory:masterfrom
solarkennedy:itest_framework

Conversation

@solarkennedy
Copy link
Copy Markdown
Contributor

Often when working with upgrades and stuff, we see breaking changes with the python bindings as the API changes.

That is fine, but now do we know what to add or when a version bump will be incompatible?

At Yelp we use docker-compose and behave to do our testing, I would like to transplant some of the infrastructure into here so everyone can see together when things break, and how.

If accepted, I'll do a second pass add travis integration, bump the version of marathon we are testing against, and then add more tests besides the trivial one.
(the most recent breakage was having the python bindings list an app that had fancy healthchecks, so I would add a test for that)

cc @ConnorDoyle @mrtyler @EvanKrall

Here is what the output looks like:

tox -e marathon_integration -r
GLOB sdist-make: /home/kwa/Projects/marathon-python/setup.py
marathon_integration recreate: /home/kwa/Projects/marathon-python/.tox/marathon_integration
marathon_integration installdeps: docker-compose, behave, mock
marathon_integration inst: /home/kwa/Projects/marathon-python/.tox/dist/marathon-0.6.15.zip
marathon_integration runtests: PYTHONHASHSEED='1571257487'
marathon_integration runtests: commands[0] | docker-compose pull
Pulling zookeeper (jplock/zookeeper:latest)...
Pulling repository jplock/zookeeper
9ce81845fa8f: Download complete
8dbd9e392a96: Download complete
08da2253f1aa: Download complete
d2249a076ab6: Download complete
8bc678765bbf: Download complete
6ea205787f72: Download complete
8d84b0f60499: Download complete
4e575f42d2ea: Download complete
1a31ff0ae6e1: Download complete
285eb269c2ab: Download complete
0d18cf8f8d7f: Download complete
9e139a0c714e: Download complete
8c2cb49d8659: Download complete
Status: Image is up to date for jplock/zookeeper:latest
Pulling marathon (mesosphere/marathon:v0.8.1)...
v0.8.1: Pulling from mesosphere/marathon
428b411c28f0: Already exists
435050075b3f: Already exists
9fd3c8c9af32: Already exists
6d4946999d4f: Already exists
193a5985f612: Already exists
dacae11ddf99: Already exists
4188e38c5565: Already exists
82e78910a7d9: Already exists
95028e8de9ec: Already exists
a9a0baf0f2e4: Already exists
5903e8a575e4: Already exists
Digest: sha256:acb57ad6bacebc9ad842a752679cf8d7321d3261794561a1ea8806c1e9bf241a
Status: Image is up to date for mesosphere/marathon:v0.8.1
marathon_integration runtests: commands[1] | docker-compose up -d
Creating itests_zookeeper_1...
Creating itests_marathon_1...
marathon_integration runtests: commands[2] | behave
Connecting to marathon on 0.0.0.0:32841
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 0.0.0.0
Connecting to marathon on 0.0.0.0:32841
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 0.0.0.0
Connecting to marathon on 0.0.0.0:32841
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 0.0.0.0
Marathon is up and running!
Feature: marathon-python can create and list marathon apps # marathon_python.feature:1

  Scenario: Trivial apps can be deployed               # marathon_python.feature:3
    Given a working marathon instance                  # steps/marathon_steps.py:12 0.008s
    When we create a trivial new app                   # steps/marathon_steps.py:22
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 0.0.0.0
    When we create a trivial new app                   # steps/marathon_steps.py:22 0.543s
    Then we should see it running via the marathon api # steps/marathon_steps.py:27
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 0.0.0.0
INFO:marathon:Got response from http://0.0.0.0:32841
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 0.0.0.0
    Then we should see it running via the marathon api # steps/marathon_steps.py:27 0.090s
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 0.0.0.0
INFO:marathon:Got response from http://0.0.0.0:32841
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 0.0.0.0
INFO:marathon:Got response from http://0.0.0.0:32841
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 0.0.0.0
INFO:marathon:Got response from http://0.0.0.0:32841
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 0.0.0.0
INFO:marathon:Got response from http://0.0.0.0:32841

1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
3 steps passed, 0 failed, 0 skipped, 0 undefined
Took 0m0.642s
_________________________________________________________________________ summary __________________________________________________________________________
  marathon_integration: commands succeeded
  congratulations :)

@solarkennedy
Copy link
Copy Markdown
Contributor Author

Please consider merging this in, a recent commit broke this module again for our use case:
d0f88e0#commitcomment-12026462

The recent test additions are good, but not as good as if they were automated and run continuously on pull requests to prevent broken code from being uploaded.

@ConnorDoyle
Copy link
Copy Markdown

cc @kolloch @aquamatthias @jsancio

@solarkennedy
Copy link
Copy Markdown
Contributor Author

I'm sad to say that between this PR and #44 and #38, this package has been unusable for us for Marathon 0.8.2 for a while.

To unblock my team, I'm going to fork this repo on the Yelp (https://github.com/Yelp/marathon-python), and add in my own PRs to add the testing frame work that I have queued up, the appid regex fix, and whatever else I need to do upgrade to 0.8.2. (mostly to get passed this zk timeout bug that is in 0.8.1)

At any time you would like these changes merged back in, simply pull from our fork or just click the green button below

|
|

@mbabineau
Copy link
Copy Markdown
Member

Clearly I'm not keeping up with PRs and issues as much as this project deserves.

Thankfully, @solarkennedy has generously offered to help out. He has been thusly anointed contributor and Grand Arbiter of PRs.

Huge thanks, solarkennedy!

@solarkennedy
Copy link
Copy Markdown
Contributor Author

I now have the power!
I'll still make PRs for review, but I'll continue pushing these tests.

solarkennedy added a commit that referenced this pull request Jul 10, 2015
First pass at adding an itest framework
@solarkennedy solarkennedy merged commit 62d3959 into thefactory:master Jul 10, 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