forked from cylc/cylc-flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
72 lines (62 loc) · 3.08 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
# Configuration for the Travis continuous integration system
# ==========================================================
#
# Travis is a free service for running automatic tests on Github repositories.
# This file configures Travis for Cylc, telling it how to install Cylc and run
# the test battery.
#
# Test results get posted back to Github. By default Travis will run tests on any
# pull requests, adding a comment on the pull request page to say if the tests
# pass or fail, it will also test any new commits, showing the test results on
# the branch page, e.g. https://github.com/cylc/cylc/branches.
#
# Connecting a Cylc branch
# ------------------------
#
# To make use of Travis you will first need to create a fork of Cylc in Github.
# Log in to https://travis-ci.org using your Github credentials, it will ask for
# permission to see your repositories, set the status of branches (whether the
# build passes or fails tests) and create hooks so Travis gets notified of new
# commits.
#
# Travis will create a list of all of your public Github repositories, you can
# enable automatic tests for a repository using the switches in this list.
#
# More information for Travis can be found at http://docs.travis-ci.com/user/getting-started/
---
language: python
# General environment setup before we start installing stuff
before_install:
# Clear bashrc - the default does nothing if not in an interactive shell.
# SSH connections use the ~/.bashrc file for their environment, so we'll be
# loading our python environment here.
- echo > ~/.bashrc
# Setup virtualenv (using system packages for pygtk as pip won't install it)
- virtualenv --system-site-packages $HOME/virtualenv/cylc
- echo "source $HOME/virtualenv/cylc/bin/activate" >> ~/.bashrc
# Make sure Cylc is in PATH when running jobs
- echo "export PATH=$PWD/bin:\$PATH" >> ~/.bashrc
# Custom diff command to ignore Xlib errors (xvfb has not RANDR extension).
- echo "export CYLC_TEST_DIFF_CMD='diff -I Xlib'" >> ~/.bashrc
# Load our new environment
- source ~/.bashrc
# These commands are run before the test
install:
# Setup local SSH for Cylc jobs
- ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
- cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- ssh-keyscan -t rsa localhost >> ~/.ssh/known_hosts
# Install dependencies
- sudo apt-get install build-essential
- sudo apt-get install at python-pip python-dev graphviz libgraphviz-dev python-gtk2-dev
- pip install Jinja2
# Pygraphviz needs special treatment to avoid an error from "from . import release"
- pip install pygraphviz --install-option="--include-path=/usr/include/graphviz" --install-option="--library-path=/usr/lib/graphviz/"
- pip install pep8
# Run tests
script:
- xvfb-run -a cylc test-battery -j 5
# Check output (more useful if you narrow down what tests get run)
after_script:
- for file in $(find $HOME/cylc-run/*/log/{job,suite}/*err -type f); do echo; echo "== $file =="; cat $file; done
- for file in $(find /tmp/cylc-tests-$USER -type f); do echo; echo "== $file =="; cat $file; done