forked from TabbycatDebate/tabbycat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
89 lines (87 loc) · 3.37 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Globals
language: python
dist: trusty
sudo: required
group: edge
env:
global:
- CC_TEST_REPORTER_ID=c18003eb2d4d191e9ebd68d9c3cf8082ba690eccac12df6660a098a78fc8713b
addons:
postgresql: "9.6"
# chrome: stable # Re-enable for functional tests if/when they work on Travis
services:
- postgresql
# Build Specific
matrix:
include:
# - os: osx
# osx_image: xcode9.1 # macOS 10.12
# language: generic # Override global
# before_install: # Need to bootstrap dependencies on macOS
# - brew update # Need to update first
# - brew upgrade python # Install latest Python3
# - export PATH="/usr/local/opt/python/libexec/bin:$PATH" # Alias 'python' to latest Python3
# - virtualenv env -p python
# - source env/bin/activate
# - python --version
# before_script:
# - brew services start postgresql
# # We are testing, in effect, the local install so use local settings:
# - cp tabbycat/local_settings.example tabbycat/local_settings.py
# script:
# - npm run build
# - python tabbycat/manage.py collectstatic
# # TODO: get working later; currently lacks a database connection
# #- python tabbycat/manage.py test -v 2 --exclude-tag=selenium
- os: linux
python: 3.5
- os: linux
python: 3.6
# Setup/run/report code coverage tool (Only one build needs to do so)
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- pip install coverage
- coverage run tabbycat/manage.py test -v 2 --exclude-tag=selenium
after_script:
- coverage xml
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
- os: linux # Test docker seperately (currently isn't supported on macOS)
language: generic
install:
- echo "Testing Docker" # Override default install steps
services:
- docker
script:
- docker-compose build
# TODO: get working later; currently lacks a database connection
# - docker-compose run web python tabbycat/manage.py test -v 2 --exclude-tag=selenium
install:
- python --version
- pip --version
- pip install --upgrade pip
- pip install -r ./config/requirements_development.txt # Needed for flake8
- node --version
- npm --version
- npm install
script:
- python tabbycat/manage.py test -v 2 --exclude-tag=selenium
- flake8 .
- npm run lint
# The below is used to enable selenium testing as per:
# https://docs.travis-ci.com/user/gui-and-headless-browsers/
# Currently it runs and loads the view; but doesn't seem to resolve the asserts
# Either the Chrome instance isn't running; or the static files aren't serving
# To rule out the former maybe disable tabbycat.standings.tests.test_ui.CoreStandingsTests
# And just let it test the login page (that should work without staticfiles)
# before_install:
# # Run google chrome in headless mode
# - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
# before_script:
# # GUI for real browsers.
# - export DISPLAY=:99.0
# - sh -e /etc/init.d/xvfb start
# - sleep 3 # give xvfb some time to start
# - dj collectstatic