Skip to content

Commit

Permalink
Add github test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans authored and 1st1 committed Dec 7, 2020
1 parent 6ef69a7 commit 3be8967
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Cython==0.29.10
aiohttp
tinys3
twine
psutil
pyOpenSSL==18.0.0
flake8>=3.7.5
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Tests

on:
push:
branches:
- master
- ci
pull_request:
branches:
- master

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7]
os: [ubuntu-16.04, macos-10.14]

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 50
submodules: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install macOS deps
if: matrix.os == 'macos-10.14'
run: |
brew install gnu-sed
brew install --force libtool
brew install --force autoconf
brew install --force automake
- name: Install Python Deps
run: |
pip install --upgrade setuptools pip wheel
pip install -U -r .github/workflows/test-requirements.txt
- name: Test
run: |
make distclean && make && make test
make distclean && make debug && make test
7 changes: 4 additions & 3 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def cb(inc=10, stop=False):
self.assertEqual(calls, [10, 1])
self.assertFalse(self.loop.is_running())

self.assertLess(finished - started, 0.1)
self.assertLess(finished - started, 0.2)
self.assertGreater(finished - started, 0.04)

def test_call_later_2(self):
Expand Down Expand Up @@ -219,9 +219,10 @@ def cb():
self.assertGreaterEqual(finished - started, 69)

def test_call_at(self):
if os.environ.get('TRAVIS_OS_NAME'):
if (os.environ.get('TRAVIS_OS_NAME')
or os.environ.get('GITHUB_WORKFLOW')):
# Time seems to be really unpredictable on Travis.
raise unittest.SkipTest('time is not monotonic on Travis')
raise unittest.SkipTest('time is not monotonic on CI')

i = 0

Expand Down
4 changes: 3 additions & 1 deletion tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,9 @@ def test_process_delayed_stdio__paused__no_stdin(self):
})

def test_process_delayed_stdio__not_paused__no_stdin(self):
if os.environ.get('TRAVIS_OS_NAME') and sys.platform == 'darwin':
if ((os.environ.get('TRAVIS_OS_NAME')
or os.environ.get('GITHUB_WORKFLOW'))
and sys.platform == 'darwin'):
# Randomly crashes on Travis, can't reproduce locally.
raise unittest.SkipTest()

Expand Down

0 comments on commit 3be8967

Please sign in to comment.