Skip to content

Commit 3be8967

Browse files
elprans1st1
authored andcommitted
Add github test workflow
1 parent 6ef69a7 commit 3be8967

File tree

4 files changed

+62
-4
lines changed

4 files changed

+62
-4
lines changed

Diff for: .github/workflows/test-requirements.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Cython==0.29.10
2+
aiohttp
3+
tinys3
4+
twine
5+
psutil
6+
pyOpenSSL==18.0.0
7+
flake8>=3.7.5

Diff for: .github/workflows/tests.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- ci
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
test:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
max-parallel: 4
17+
matrix:
18+
python-version: [3.6, 3.7]
19+
os: [ubuntu-16.04, macos-10.14]
20+
21+
steps:
22+
- uses: actions/checkout@v1
23+
with:
24+
fetch-depth: 50
25+
submodules: true
26+
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v1
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install macOS deps
33+
if: matrix.os == 'macos-10.14'
34+
run: |
35+
brew install gnu-sed
36+
brew install --force libtool
37+
brew install --force autoconf
38+
brew install --force automake
39+
40+
- name: Install Python Deps
41+
run: |
42+
pip install --upgrade setuptools pip wheel
43+
pip install -U -r .github/workflows/test-requirements.txt
44+
45+
- name: Test
46+
run: |
47+
make distclean && make && make test
48+
make distclean && make debug && make test

Diff for: tests/test_base.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def cb(inc=10, stop=False):
159159
self.assertEqual(calls, [10, 1])
160160
self.assertFalse(self.loop.is_running())
161161

162-
self.assertLess(finished - started, 0.1)
162+
self.assertLess(finished - started, 0.2)
163163
self.assertGreater(finished - started, 0.04)
164164

165165
def test_call_later_2(self):
@@ -219,9 +219,10 @@ def cb():
219219
self.assertGreaterEqual(finished - started, 69)
220220

221221
def test_call_at(self):
222-
if os.environ.get('TRAVIS_OS_NAME'):
222+
if (os.environ.get('TRAVIS_OS_NAME')
223+
or os.environ.get('GITHUB_WORKFLOW')):
223224
# Time seems to be really unpredictable on Travis.
224-
raise unittest.SkipTest('time is not monotonic on Travis')
225+
raise unittest.SkipTest('time is not monotonic on CI')
225226

226227
i = 0
227228

Diff for: tests/test_process.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,9 @@ def test_process_delayed_stdio__paused__no_stdin(self):
840840
})
841841

842842
def test_process_delayed_stdio__not_paused__no_stdin(self):
843-
if os.environ.get('TRAVIS_OS_NAME') and sys.platform == 'darwin':
843+
if ((os.environ.get('TRAVIS_OS_NAME')
844+
or os.environ.get('GITHUB_WORKFLOW'))
845+
and sys.platform == 'darwin'):
844846
# Randomly crashes on Travis, can't reproduce locally.
845847
raise unittest.SkipTest()
846848

0 commit comments

Comments
 (0)