Files
Eric Larson 5389a456c4 ENH: Speed up a couple of tests (#5348)
* ENH: Speed up a couple of tests

* FIX: Combine runs
2018-07-18 13:49:05 -04:00

178 lines
7.0 KiB
YAML

language: c
dist: trusty
sudo: false
cache:
apt: true
pip: true
env:
# TRAVIS_PYTHON_VERSION is only needed for neo's setup.py
global: PYTHON_VERSION=3.6 DISPLAY=:99.0 MNE_LOGGING_LEVEL=warning TEST_LOCATION=src
PIP_DEPENDENCIES="codecov pytest-faulthandler pytest-sugar" OPTION=""
TRAVIS_PYTHON_VERSION=3.6 CONDA_VERSION=">=4.3.27"
matrix:
include:
# No data + style testing
- os: linux
env: DEPS=nodata MNE_DONTWRITE_HOME=true MNE_FORCE_SERIAL=true MNE_SKIP_NETWORK_TEST=1
CONDA_DEPENDENCIES="numpy scipy matplotlib sphinx pytest pytest-cov"
PIP_DEPENDENCIES="flake8 numpydoc codespell git+git://github.com/PyCQA/pydocstyle.git codecov check-manifest pytest-sugar"
OPTION="--doctest-ignore-import-errors"
# Linux
- os: linux
env: CONDA_ENVIRONMENT="environment.yml"
# OSX conda
- os: osx
env: CONDA_ENVIRONMENT="environment.yml"
# PIP + non-default stim channel
# OPENBLAS_NUM_THREADS=1 avoid slowdowns:
# https://github.com/xianyi/OpenBLAS/issues/731
- os: linux
env: MNE_STIM_CHANNEL=STI101
OPENBLAS_NUM_THREADS=1
language: python
python: "3.6"
# 2.7 Old dependencies
- os: linux
env: PYTHON_VERSION=2.7
CONDA_DEPENDENCIES="numpy=1.8 scipy=0.12 matplotlib=1.3 pandas=0.13 scikit-learn=0.15 pytest pytest-cov"
# Minimal
- os: linux
env: DEPS=minimial
CONDA_DEPENDENCIES="numpy scipy matplotlib pytest pytest-cov"
# Setup anaconda
before_install:
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset;
fi;
- if [ -z "$CONDA_ENVIRONMENT" ] && [ -z "$CONDA_DEPENDENCIES" ]; then
pip uninstall -y numpy;
pip install numpy scipy vtk;
pip install -r requirements.txt;
else
git clone https://github.com/astropy/ci-helpers.git;
source ci-helpers/travis/setup_conda.sh;
if [ ! -z "$CONDA_ENVIRONMENT" ]; then
pip uninstall --yes mne;
fi;
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
pip install --upgrade pyqt5>=5.10;
fi;
fi
# Don't source mne_setup_sh here because changing PATH etc. can't be done in a script
- if [ "${DEPS}" == "" ]; then
export MNE_ROOT="${PWD}/minimal_cmds";
export PATH=${MNE_ROOT}/bin:$PATH;
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
curl https://staff.washington.edu/larsoner/minimal_cmds.tar.gz | tar xz;
export LD_LIBRARY_PATH=${MNE_ROOT}/lib:$LD_LIBRARY_PATH;
export NEUROMAG2FT_ROOT="${PWD}/minimal_cmds/bin";
else
curl https://staff.washington.edu/larsoner/minimal_cmds_osx.tar.gz | tar xz;
export DYLD_LIBRARY_PATH=${MNE_ROOT}/lib:$DYLD_LIBRARY_PATH;
fi;
mne_surf2bem --version;
fi;
install:
# Rvm overrides cd with a function so that it can hook into it to run
# some scripts, see https://github.com/travis-ci/travis-ci/issues/8703
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
unset -f cd;
fi;
# Suppress the parallel outputs for logging cleanliness
- python setup.py build
- python setup.py install
- python -c "import mne; mne.sys_info()"
- SRC_DIR=$(pwd)
- cd ~
# Trigger download of testing data. Note that
# the testing dataset has been constructed to contain the necessary
# files to act as a FREESURFER_HOME for the coreg tests
- if [ "${DEPS}" != "nodata" ]; then
python -c 'import mne; mne.datasets.testing.data_path(verbose=True)';
ls -al $HOME/mne_data/;
ls -al $HOME/mne_data/MNE-testing-data/;
ls -al $HOME/mne_data/MNE-testing-data/MEG/;
ls -al $HOME/mne_data/MNE-testing-data/MEG/sample/;
if [ "${DEPS}" == "" ] && [ "${TRAVIS_OS_NAME}" == "linux" ]; then
export FREESURFER_HOME=$(python -c 'import mne; print(mne.datasets.testing.data_path())');
export MNE_SKIP_FS_FLASH_CALL=1;
fi;
else
export MNE_SKIP_TESTING_DATASET_TESTS=true;
fi;
- MNE_DIR=$(python -c 'import mne;print(mne.__path__[0])')
# We run two versions: one out of the source directory (that makes
# coveralls coverage work), and one out of the install directory (that
# ensures we have included all necessary files).
- if [ "${TEST_LOCATION}" == "install" ]; then
ln -s ${SRC_DIR}/mne/io/tests/data ${MNE_DIR}/io/tests/data;
ln -s ${SRC_DIR}/mne/io/bti/tests/data ${MNE_DIR}/io/bti/tests/data;
ln -s ${SRC_DIR}/mne/io/edf/tests/data ${MNE_DIR}/io/edf/tests/data;
ln -s ${SRC_DIR}/mne/io/kit/tests/data ${MNE_DIR}/io/kit/tests/data;
ln -s ${SRC_DIR}/mne/io/brainvision/tests/data ${MNE_DIR}/io/brainvision/tests/data;
ln -s ${SRC_DIR}/mne/io/egi/tests/data ${MNE_DIR}/io/egi/tests/data;
ln -s ${SRC_DIR}/mne/io/nicolet/tests/data ${MNE_DIR}/io/nicolet/tests/data;
ln -s ${SRC_DIR}/mne/preprocessing/tests/data ${MNE_DIR}/preprocessing/tests/data;
ln -s ${SRC_DIR}/setup.cfg ${MNE_DIR}/../setup.cfg;
ln -s ${SRC_DIR}/.coveragerc ${MNE_DIR}/../.coveragerc;
cd ${MNE_DIR}/../;
COVERAGE=;
else
cd ${SRC_DIR};
COVERAGE=--with-coverage;
fi;
script:
- echo "Print locale "
- locale
- echo "Other stuff"
# OSX runs ~2x slower than Linux on Travis, so skip any slow ones there
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
CONDITION='not slowtest';
else
CONDITION='not ultraslowtest';
fi;
- python -c "import mne; print(mne.sys_info())"
# Determine directories to test (could use SPLIT=0 SPLIT=1 but currently
# we are fast enough, so disable it)
- if [ -z ${SPLIT} ]; then
USE_DIRS="mne/";
else
if [ "${SPLIT}" == "0" ]; then
MNE_DIRS=". beamformer channels commands connectivity datasets decoding forward gui inverse_sparse io";
elif [ "${SPLIT}" == "1" ]; then
MNE_DIRS="minimum_norm preprocessing realtime simulation stats time_frequency viz";
elif [ "${SPLIT}" == "2" ]; then
MNE_DIRS=".";
else
MNE_DIRS="beamformer channels commands connectivity datasets decoding forward gui inverse_sparse io";
fi;
USE_DIRS="";
for DIR in ${MNE_DIRS}; do
if [ "${DIR}" == "." ]; then
USE_DIRS="mne/tests mne/*.py ${USE_DIRS}";
else
USE_DIRS="mne/${DIR}/ ${USE_DIRS}";
fi;
done;
fi;
- echo py.test -m "${CONDITION}" ${OPTION} ${USE_DIRS} --cov=mne;
- py.test -m "${CONDITION}" ${OPTION} ${USE_DIRS} --cov=mne;
- if [ "${DEPS}" == "nodata" ]; then
make pep;
fi;
after_script:
# Need to run from source dir to exectue "git" commands
- cd ${SRC_DIR};
- codecov;