-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
98 lines (81 loc) · 2.97 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
90
91
92
93
94
95
96
97
98
language: python
sudo: required
dist: trusty
services:
- docker
cache:
directories:
- $HOME/.cache/pip
matrix:
include:
# do not install libca / libcom from pyepics
- python: 2.7
env: NOLIBCA=1
- python: 3.5
env: NOLIBCA=1
- python: 3.6
env: NOLIBCA=1
# install libca / libcom from pyepics
- python: 2.7
- python: 3.5
- python: 3.6
before_install:
- export DOCKER0_IP=$(/sbin/ifconfig docker0 |grep 'inet addr' | sed -e 's/.*addr:\([^ ]*\).*/\1/')
- export EPICS_CA_ADDR_LIST=$( echo $DOCKER0_IP | sed -e 's/^\([0-9]\+\)\.\([0-9]\+\)\..*$/\1.\2.255.255/' )
- export EPICS_CA_AUTO_ADDR_LIST="no"
- export EPICS_CA_MAX_ARRAY_BYTES=10000000
- export DOCKERIMAGE="klauer/simioc-docker"
- export DOCKERTAG="pyepics-docker"
- export CONDA_ENV="testenv"
- perl --version
- docker pull ${DOCKERIMAGE}:${DOCKERTAG}
- docker images
- docker ps -a
- docker run -d -p $DOCKER0_IP:7000-8000:5064/tcp --name epics_iocs ${DOCKERIMAGE}:${DOCKERTAG}
- docker ps -a
# INSTALL CONDA
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- "./miniconda.sh -b -p /home/travis/mc"
- if [ -n "$NOLIBCA" ]; then export PYEPICS_LIBCA=$HOME/mc/envs/$CONDA_ENV/lib/libca.so; fi
- env
- export PATH=/home/travis/mc/bin:$PATH
- conda config --set always_yes true
- conda update conda --yes
- conda config --add channels lightsource2-tag
# MAKE THE CONDA RECIPE
- conda create -n $CONDA_ENV python=$TRAVIS_PYTHON_VERSION epics-base
- source activate $CONDA_ENV
install:
# install pyepics dependencies
- conda install numpy
- pip install coveralls pytest pytest-cov
# install pyepics as a source install
- pip install -v .
# allow gdb backtrace to show when tests fail
- sudo apt-get -y install gdb
- ulimit -c
before_script:
# ref: github.com/springmeyer/travis-coredump
- ulimit -c unlimited -S
script:
- cd tests
# check/record some basic pyepics things
- echo "Checking pyepics version and libca locations:"
- python -c "import epics; print(epics.__version__)"
- python -c "import epics.ca; print(epics.ca.find_libca())"
- echo "Checking if the motor/areadetector IOC is running:"
- python -c "import epics; print('mtr1', epics.caget('sim:mtr1.RBV'))"
- python -c "import epics; print('arraycounter', epics.caget('sim:det:ROI1:ArrayCounter'))"
- echo "Checking if the pyepics test suite ioc is running:"
- python -c "import epics; print('long1', epics.caget('Py:long1'))"
- caget sim:mtr1.RBV
- caget sim:det:ROI1:ArrayCounter
- caget Py:long1
# running tests
- py.test -vv -rsx --cov=epics --cov-report term-missing test_install.py ca_unittest.py pv_unittest.py test_pool.py test_threading.py test_cas.py || RESULT=$?
- if [[ ${RESULT} != 0 ]]; then gdb python core* -ex "thread apply all bt" -ex "set pagination 0" -batch; fi
- if [[ ${RESULT} != 0 ]]; then exit $RESULT ; fi;
after_success:
- env
- coveralls