Skip to content

Commit

Permalink
Add Github Workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
xethorn committed May 2, 2020
1 parent b28f809 commit 0828852
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 36 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Garcon / Pull Request / Tests

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-tests.txt
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
pytest --cov=.
coveralls
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
flake8
wheel
pytest-cov==2.5.1
pytest==3.6.3
python-coveralls==2.4.3
tox==2.9.1
coveralls==1.10.0
4 changes: 2 additions & 2 deletions tests/test_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ def test_create_activity(monkeypatch, boto_client):
assert isinstance(current_activity, activity.Activity)
assert current_activity.name == 'flow_name_activity_name'
assert current_activity.task_list == 'flow_name_activity_name'
assert current_activity.domain is 'domain_name'
assert current_activity.client is boto_client
assert current_activity.domain == 'domain_name'
assert current_activity.client == boto_client


def test_create_external_activity(monkeypatch, boto_client):
Expand Down
7 changes: 4 additions & 3 deletions tests/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test():
assert test.__garcon__.get('foo') is None

task._decorate(test, 'foo', 'bar')
assert test.__garcon__.get('foo') is 'bar'
assert test.__garcon__.get('foo') == 'bar'


def test_generator_decorator():
Expand Down Expand Up @@ -108,7 +108,7 @@ def testB():

task._link_decorator(testA, testB)
assert not getattr(testA, '__garcon__', None)
assert len(testB.__garcon__) is 0
assert len(testB.__garcon__) == 0

task._decorate(testB, 'foo', 'value')
assert testB.__garcon__.get('foo') == 'value'
Expand All @@ -123,7 +123,7 @@ def test_task_decorator():

@task.decorate(timeout=timeout)
def test(user):
assert user is userinfo
assert user == userinfo

assert test.__garcon__.get('timeout') == timeout
assert test.__garcon__.get('heartbeat') == timeout
Expand Down Expand Up @@ -153,6 +153,7 @@ def test_task_decorator_with_heartbeat():
"""

heartbeat = 50
userinfo = None

@task.decorate(heartbeat=heartbeat)
def test(user):
Expand Down

0 comments on commit 0828852

Please sign in to comment.