Skip to content

Commit 3c7d5a7

Browse files
authored
Use Travis CI to run tests on every pull request
This is a second attempt at nodejs#1336 which got into a bad git-state... Use flake8 to find Python syntax errors and undefined names. There are Python 3 syntax errors and many undefined names which may raise NameError at runtime. This PR runs flake8 runs in two passes: The first looks at critical issues in stop-the-build mode and the second looks at style violations in everything-is-a-warning mode.
1 parent 721eb69 commit 3c7d5a7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.travis.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
dist:xenial
2+
language: python
3+
cache: pip
4+
python:
5+
- 2.7
6+
- 3.7
7+
matrix:
8+
allow_failures:
9+
- python: 3.7
10+
install:
11+
#- pip install -r requirements.txt
12+
- pip install flake8 # pytest # add another testing frameworks later
13+
before_script:
14+
# stop the build if there are Python syntax errors or undefined names
15+
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
16+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
17+
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
18+
- npm install
19+
script:
20+
- npm test
21+
#- pytest --capture=sys # add other tests here
22+
notifications:
23+
on_success: change
24+
on_failure: change # `always` will be the setting once code changes slow down

0 commit comments

Comments
 (0)