Skip to content

Commit

Permalink
Remove unnecessary scripts, and add other adjustments for build speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno P. Kinoshita committed Nov 15, 2018
1 parent dcd81b5 commit 5d6102d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 75 deletions.
45 changes: 24 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,46 @@

---
language: python
sudo: required
dist: trusty
cache: pip
virtualenv:
# we need system packages in Travis-CI's virtualenv in order to access pygtk, installed via apt-get
system_site_packages: true
dist: xenial
addons:
apt:
# instruct travis-ci to always run apt-get before each build
update: true

stages:
- unit-test
- test

env:
- CHUNK="1/4"
- CHUNK="2/4"
- CHUNK="3/4"
- CHUNK="4/4"
global:
- PATH="${TRAVIS_BUILD_DIR}/bin:$PATH"
# Only run the generic tests on Travis CI.
- CYLC_TEST_RUN_PLATFORM=false
# Custom diff command to ignore Xlib errors (xvfb has not RANDR extension).
- CYLC_TEST_DIFF_CMD="diff -I Xlib -u"
matrix:
- CHUNK="1/4"
- CHUNK="2/4"
- CHUNK="3/4"
- CHUNK="4/4"

before_install: .travis/before_install.sh
install: .travis/install.sh
# this is the default test stage, which is used for functional-tests
install: .travis/install.sh functional-tests docs
script:
- source ~/.bashrc
# Custom diff command to ignore Xlib errors (xvfb has not RANDR extension).
- export CYLC_TEST_DIFF_CMD='diff -I Xlib -u'
# Only run the generic tests on Travis CI.
- export CYLC_TEST_RUN_PLATFORM=false
# Run tests with virtual frame buffer for X support.
- xvfb-run -a cylc test-battery --chunk $CHUNK --state=save -j 5 || (echo -e "\n\nRerunning Failed Tests...\n\n"; cylc test-battery --state=failed -j 5)


after_script: .travis/after_script.sh

jobs:
include:
- stage: unit-test
before_install: .travis/before_install.sh
install:
- .travis/install.sh
# these dependencies are necessary only for the unit tests
- source ~/.bashrc
- pip install pycodestyle pytest mock
- .travis/install.sh unit-tests
script:
- source ~/.bashrc
- pycodestyle --ignore=E402,W503,W504 lib/cylc lib/Jinja2Filters/*.py lib/parsec/*.py $(grep -l '#!.*\<python\>' bin/*)
- PYTHONPATH=$(pwd -P)/lib/ pytest lib/cylc/
after_script: true
4 changes: 0 additions & 4 deletions .travis/after_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

set -x

# Travis-CI after_script

# Check output (more useful if you narrow down what tests get run)

source ~/.bashrc

find $HOME/cylc-run -name '*.err' -type f -exec echo '==== {} ====' \; -exec cat '{}' \;
find /tmp/${USER}/cylctb-* -type f -exec echo '==== {} ====' \; -exec cat '{}' \;
36 changes: 0 additions & 36 deletions .travis/before_install.sh

This file was deleted.

37 changes: 23 additions & 14 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,34 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

set -x
set -eu
set -o xtrace
shopt -s extglob

# Travis-CI install

source ~/.bashrc
args=("$@")

# Setup local SSH for Cylc jobs
# pygtk via apt-get, necessary for both unit and functional tests
sudo apt-get install graphviz libgraphviz-dev python-gtk2-dev heirloom-mailx

# install dependencies required for running unit tests
if grep 'unit-tests' <<< "${args[@]}"; then
pip install EmPy pyopenssl pycodestyle pytest mock
# install dependencies required for running functional tests
elif grep 'functional-tests' <<< "${args[@]}"; then
# pygraphviz needs special treatment to avoid an error from "from . import release"
pip install EmPy pyopenssl pygraphviz \
--install-option="--include-path=/usr/include/graphviz" \
--install-option="--library-path=/usr/lib/graphviz/"
fi

# install dependencies required for building documentation, only when instructed to do so
if grep 'docs' <<< "${args[@]}$"; then
sudo apt-get install texlive-latex-base
fi

# configure 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 update -qq
sudo apt-get install build-essential texlive-latex-base
sudo apt-get install at python-pip python-dev graphviz libgraphviz-dev python-gtk2-dev heirloom-mailx

# 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 EmPy pyopenssl

0 comments on commit 5d6102d

Please sign in to comment.