Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul CKAN extension Travis template
* add tests for multiple CKAN versions * add fix for psycopg2 error with CKAN<2.8 * add correct setuptools version for CKAN==2.7 * `--allow-all-external` option was deprecated and removed in pip 10 * SOLR's config sed command is moved, to travis-build.bash, with the other setup, and in line with ckanext-dcat * flake8's simple checks for syntax is moved from a travis job to travis-run.sh, because it runs in 0.5s, but setting up the VM for the job takes 30-60s, so might as well just run it at the start of the test jobs. The point is to fail fast. This requires the addition of 'set -ex' in the . * add strict flake8 linting - this is perhaps a matter of taste, but as a practice it's more popular than ever now, and it's always easiest to do it from the beginning of an extension's life.
- Loading branch information
David Read
committed
May 3, 2019
1 parent
32080c1
commit 47f1c97
Showing
3 changed files
with
70 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,44 @@ | ||
language: python | ||
sudo: required | ||
|
||
# use an older trusty image, because the newer images cause build errors with | ||
# psycopg2 that comes with CKAN<2.8: | ||
# "Error: could not determine PostgreSQL version from '10.1'" | ||
# see https://github.com/travis-ci/travis-ci/issues/8897 | ||
dist: trusty | ||
group: deprecated-2017Q4 | ||
|
||
# matrix | ||
python: | ||
- "2.7" | ||
- 2.7 | ||
env: | ||
- CKANVERSION=master | ||
- CKANVERSION=2.7 | ||
- CKANVERSION=2.8 | ||
|
||
# tests | ||
services: | ||
- postgresql | ||
- redis-server | ||
- postgresql | ||
- redis-server | ||
install: | ||
- bash bin/travis-build.bash | ||
- pip install coveralls | ||
- bash bin/travis-build.bash | ||
- pip install coveralls | ||
script: sh bin/travis-run.sh | ||
after_success: | ||
- coveralls | ||
- coveralls | ||
|
||
# additional jobs | ||
matrix: | ||
include: | ||
- name: "Flake8 on Python 3.7" | ||
dist: xenial # required for Python 3.7 | ||
cache: pip | ||
install: pip install flake8 | ||
script: | ||
- flake8 --version | ||
- flake8 . --count --max-complexity=10 --max-line-length=127 --statistics --exclude ckan,{{ project }} | ||
python: 3.7 | ||
# overwrite matrix | ||
env: | ||
- FLAKE8=true | ||
- CKANVERSION=master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters