Skip to content

Commit

Permalink
add travis tests and fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
rmb938 committed Jan 9, 2018
1 parent 9e38c01 commit 273d90f
Show file tree
Hide file tree
Showing 43 changed files with 58 additions and 40 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[run]
omit =
*/test/*

[report]
exclude_lines =
pragma: no cover
def __repr__
raise NotImplementedError
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
language: python
python:
- '3.6'
env:
- TOXENV=flake8
- TOXENV=build
install:
- pip install tox
script: tox
services:
- docker
stages:
- test
- name: pypi
if: tag IS present
- name: docker
if: tag IS present
jobs:
include:
- stage: pypi
script: echo "Deploying to PyPi"
deploy:
provider: pypi
distributions: bdist_wheel
user: rmb938
password:
secure: n2LVNQ0TYNx/u5Ygh4ZgJ2reLAjLrDKBD1VhPAnlsnlaMSEBNnjZmC8WvzrMhHZvzT855vgNGp1LWBqKaE6uGBu/YOZyD7OkzWQbokmBU20k63erHDK8/mImdubAtzy33PsDyklbcHJXdZyaUwJmFZFlFxE97UZLbgijkyoC+CZ6i5DquJ4UDuR0PT8kw9oiBBlC9CBQV3D7W8m+FnYGenk2HViwiXqR9L5b2IRuIb5mkd/y7dJFUYmzFzLjafwSaWYUixVMO6Ml3hPAcimxGICdzOLH3X9Dxzt1S0zaCqsrK5a2HoaXKYh6ToTz5mGZsEsOVj8OJ/czR33NsVnrS4HoeGAauM4A5pkv8XgYmzgq2sQhNFZXHK7ePvhRPhP7gEg51cHJkGD0PpiHX+ls3+qy9NDnD72j9NAepLO7mRsBExxPngms9EenFLCAtVmHEMw4eem7DYqGfowKL5y3gWqefqnOxLK0rfst7JcQ2wquyo8D3vGJ6TaNENsykuARfMGURujdxp87U4T+0IU9KBxGQ+Xv8h4zr1j9IBD9JfrkaraPlGIBlhU2a4LWcrmECRgEOTamAIWIhWeA1AUxezHBt3hJ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kR6wT6EBtMfAMc=
script: ./trigger_docker_build.sh
1 change: 0 additions & 1 deletion deli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/auth/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/auth/drivers/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/auth/drivers/database/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/auth/drivers/database/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/cli/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/http/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/http/mounts/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/http/mounts/root/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/http/mounts/root/routes/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/http/mounts/root/routes/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/counter/http/mounts/root/routes/v1/auth/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

4 changes: 2 additions & 2 deletions deli/counter/http/mounts/root/routes/v1/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import cherrypy

from deli.counter.http.mounts.root.routes.v1.validation_models.images import ResponseImage
from deli.counter.http.mounts.root.routes.v1.validation_models.instances import RequestCreateInstance, ResponseInstance, \
ParamsInstance, ParamsListInstance, RequestInstancePowerOffRestart, RequestInstanceImage
from deli.counter.http.mounts.root.routes.v1.validation_models.instances import RequestCreateInstance, \
ResponseInstance, ParamsInstance, ParamsListInstance, RequestInstancePowerOffRestart, RequestInstanceImage
from deli.http.request_methods import RequestMethods
from deli.http.route import Route
from deli.http.router import Router
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

4 changes: 2 additions & 2 deletions deli/counter/http/mounts/root/routes/v1/zones.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cherrypy

from deli.counter.http.mounts.root.routes.v1.validation_models.zones import RequestCreateZone, ResponseZone, ParamsZone, \
ParamsListZone, RequestZoneSchedule
from deli.counter.http.mounts.root.routes.v1.validation_models.zones import RequestCreateZone, ResponseZone, \
ParamsZone, ParamsListZone, RequestZoneSchedule
from deli.http.request_methods import RequestMethods
from deli.http.route import Route
from deli.http.router import Router
Expand Down
1 change: 0 additions & 1 deletion deli/http/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/kubernetes/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

2 changes: 1 addition & 1 deletion deli/kubernetes/informer.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def run(self):
for _, obj in new_cache.items():
self.queue.put(("MODIFIED", obj))
self.first_run = False
except:
except Exception:
self.logger.error(
"Caught Exception while listing " + self.name +
" sleeping for 30 seconds before trying again. Enable debug logging to see exception")
Expand Down
1 change: 0 additions & 1 deletion deli/kubernetes/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/kubernetes/resources/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/kubernetes/resources/v1alpha1/image/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/kubernetes/resources/v1alpha1/instance/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/kubernetes/resources/v1alpha1/keypair/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/kubernetes/resources/v1alpha1/network/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/kubernetes/resources/v1alpha1/region/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/kubernetes/resources/v1alpha1/role/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/kubernetes/resources/v1alpha1/zone/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/manager/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/manager/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/manager/cli/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/menu/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/menu/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/menu/cli/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

1 change: 0 additions & 1 deletion deli/menu/vspc/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

4 changes: 4 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pytest==3.0.7 # MIT
pytest-cov==2.4.0 # MIT
WebTest==2.0.28 # MIT
Faker==0.8.6 # MIT
Empty file added test/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions trigger_docker_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

curl -H "Content-Type: application/json" -d "{\"source_type\": \"Tag\", \"source_name\": \"$TRAVIS_TAG\"}" -X POST "$COUNTER_DOCKER_HUB_TRIGGER"
curl -H "Content-Type: application/json" -d "{\"source_type\": \"Tag\", \"source_name\": \"$TRAVIS_TAG\"}" -X POST "$MANAGER_DOCKER_HUB_TRIGGER"
curl -H "Content-Type: application/json" -d "{\"source_type\": \"Tag\", \"source_name\": \"$TRAVIS_TAG\"}" -X POST "$MENU_DOCKER_HUB_TRIGGER"

0 comments on commit 273d90f

Please sign in to comment.