2016-12-30 13:59:21 -08:00
|
|
|
#=============================================================================
|
|
|
|
# Project settings
|
|
|
|
#=============================================================================
|
2016-10-28 13:26:20 -07:00
|
|
|
# Only build master and develop on push; do not build every branch.
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- develop
|
2017-01-15 18:45:38 -08:00
|
|
|
- /^releases\/.*$/
|
2016-10-28 13:26:20 -07:00
|
|
|
|
2016-12-30 13:59:21 -08:00
|
|
|
#=============================================================================
|
|
|
|
# Build matrix
|
|
|
|
#=============================================================================
|
2018-07-24 08:07:36 +02:00
|
|
|
|
2020-05-12 22:56:01 +02:00
|
|
|
dist: bionic
|
2018-07-24 08:07:36 +02:00
|
|
|
|
2017-08-19 23:52:27 +02:00
|
|
|
jobs:
|
2017-02-11 03:21:52 +01:00
|
|
|
fast_finish: true
|
2016-12-30 13:59:21 -08:00
|
|
|
include:
|
2018-07-23 01:38:09 -07:00
|
|
|
- stage: 'style checks'
|
2019-10-31 14:20:46 -05:00
|
|
|
python: '3.8'
|
2017-01-26 02:19:35 -08:00
|
|
|
os: linux
|
|
|
|
language: python
|
2017-08-19 23:52:27 +02:00
|
|
|
env: TEST_SUITE=flake8
|
2018-07-23 01:38:09 -07:00
|
|
|
- stage: 'unit tests + documentation'
|
2017-08-19 23:52:27 +02:00
|
|
|
python: '2.6'
|
2018-12-14 17:43:58 +01:00
|
|
|
dist: trusty
|
2017-01-26 02:19:35 -08:00
|
|
|
os: linux
|
|
|
|
language: python
|
2020-05-09 19:41:50 +02:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
# Everything but patchelf, that is not available for trusty
|
|
|
|
packages:
|
|
|
|
- ccache
|
|
|
|
- gfortran
|
|
|
|
- graphviz
|
|
|
|
- gnupg2
|
|
|
|
- kcov
|
|
|
|
- mercurial
|
|
|
|
- ninja-build
|
|
|
|
- realpath
|
|
|
|
- zsh
|
2019-05-10 11:24:14 -07:00
|
|
|
env: [ TEST_SUITE=unit, COVERAGE=true ]
|
2017-04-27 11:47:56 -07:00
|
|
|
- python: '2.7'
|
|
|
|
os: linux
|
|
|
|
language: python
|
2020-05-12 22:56:01 +02:00
|
|
|
env: [ TEST_SUITE=unit, COVERAGE=true, KCOV_VERSION=34 ]
|
2017-03-26 18:02:56 -07:00
|
|
|
- python: '3.5'
|
|
|
|
os: linux
|
2020-05-12 22:56:01 +02:00
|
|
|
dist: xenial
|
2017-03-26 18:02:56 -07:00
|
|
|
language: python
|
|
|
|
env: TEST_SUITE=unit
|
|
|
|
- python: '3.6'
|
|
|
|
os: linux
|
|
|
|
language: python
|
2018-08-03 20:39:43 -05:00
|
|
|
env: TEST_SUITE=unit
|
2018-07-24 08:07:36 +02:00
|
|
|
- python: '3.7'
|
2019-10-31 14:20:46 -05:00
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: TEST_SUITE=unit
|
|
|
|
- python: '3.8'
|
2018-07-24 08:07:36 +02:00
|
|
|
os: linux
|
|
|
|
language: python
|
2020-05-12 22:56:01 +02:00
|
|
|
env: [ TEST_SUITE=unit, COVERAGE=true, KCOV_VERSION=34 ]
|
|
|
|
- python: '3.8'
|
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: [ TEST_SUITE=shell, COVERAGE=true, KCOV_VERSION=38 ]
|
2019-10-31 14:20:46 -05:00
|
|
|
- python: '3.8'
|
2018-07-23 01:38:09 -07:00
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: TEST_SUITE=doc
|
2015-11-29 21:40:23 -08:00
|
|
|
|
2018-01-18 20:06:26 +01:00
|
|
|
stages:
|
2018-07-23 01:38:09 -07:00
|
|
|
- 'style checks'
|
|
|
|
- 'unit tests + documentation'
|
2018-01-18 20:06:26 +01:00
|
|
|
|
|
|
|
|
2016-12-30 13:59:21 -08:00
|
|
|
#=============================================================================
|
|
|
|
# Environment
|
|
|
|
#=============================================================================
|
2015-11-29 22:09:11 -08:00
|
|
|
|
2016-08-30 20:07:21 -07:00
|
|
|
# Docs need graphviz to build
|
|
|
|
addons:
|
2018-12-28 21:12:02 -08:00
|
|
|
# for Linux builds, we use APT
|
2016-08-30 20:07:21 -07:00
|
|
|
apt:
|
|
|
|
packages:
|
2018-12-15 04:52:31 -05:00
|
|
|
- ccache
|
2020-05-12 22:56:01 +02:00
|
|
|
- coreutils
|
2016-12-30 13:53:30 -08:00
|
|
|
- gfortran
|
2016-08-30 20:07:21 -07:00
|
|
|
- graphviz
|
2017-05-26 13:31:04 -04:00
|
|
|
- gnupg2
|
2018-12-29 12:26:16 -08:00
|
|
|
- mercurial
|
2018-08-20 16:42:28 -05:00
|
|
|
- ninja-build
|
2020-05-09 19:41:50 +02:00
|
|
|
- patchelf
|
2019-07-03 01:56:13 -07:00
|
|
|
- zsh
|
2019-06-19 02:50:45 +02:00
|
|
|
update: true
|
2017-08-19 23:52:27 +02:00
|
|
|
|
2018-12-15 17:53:51 +01:00
|
|
|
# ~/.ccache needs to be cached directly as Travis is not taking care of it
|
|
|
|
# (possibly because we use 'language: python' and not 'language: c')
|
2018-03-06 06:49:43 +01:00
|
|
|
cache:
|
|
|
|
pip: true
|
2018-12-15 04:52:31 -05:00
|
|
|
ccache: true
|
2018-03-06 06:49:43 +01:00
|
|
|
directories:
|
2018-12-15 17:53:51 +01:00
|
|
|
- ~/.ccache
|
2016-08-30 20:07:21 -07:00
|
|
|
|
2016-12-30 13:59:21 -08:00
|
|
|
before_install:
|
2018-12-15 04:52:31 -05:00
|
|
|
- ccache -M 2G && ccache -z
|
2020-05-12 22:56:01 +02:00
|
|
|
# Install kcov manually, since it's not packaged for bionic beaver
|
|
|
|
- if [[ "$KCOV_VERSION" ]]; then
|
|
|
|
sudo apt-get -y install cmake binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev;
|
|
|
|
KCOV_ROOT=$(mktemp -d);
|
|
|
|
wget --output-document=${KCOV_ROOT}/${KCOV_VERSION}.tar.gz https://github.com/SimonKagstrom/kcov/archive/v${KCOV_VERSION}.tar.gz;
|
|
|
|
tar -C ${KCOV_ROOT} -xzvf ${KCOV_ROOT}/${KCOV_VERSION}.tar.gz;
|
|
|
|
mkdir -p ${KCOV_ROOT}/build;
|
|
|
|
cd ${KCOV_ROOT}/build && cmake -Wno-dev ${KCOV_ROOT}/kcov-${KCOV_VERSION} && cd - ;
|
|
|
|
make -C ${KCOV_ROOT}/build && sudo make -C ${KCOV_ROOT}/build install;
|
|
|
|
fi
|
2016-12-30 13:59:21 -08:00
|
|
|
|
2016-08-22 10:22:42 -05:00
|
|
|
# Install various dependencies
|
2016-01-19 18:29:39 +01:00
|
|
|
install:
|
2017-05-09 13:59:59 -05:00
|
|
|
- pip install --upgrade pip
|
2017-06-01 14:42:33 +02:00
|
|
|
- pip install --upgrade six
|
2017-05-09 13:59:59 -05:00
|
|
|
- pip install --upgrade setuptools
|
2019-12-16 10:56:54 +01:00
|
|
|
- pip install --upgrade codecov coverage==4.5.4
|
unit tests: replace nose with pytest (#2502)
* Porting: substitute nose with ytest
This huge commit substitutes nose with pytest as a testing system. Things done here:
* deleted external/nose as it is no longer used
* moved mock resources in their own directory 'test/mock/'
* ported two tests (cmd/find, build_system) to pytest native syntax as an example
* build_environment, log: used monkeypatch instead of try/catch
* moved global mocking of fetch_cache to an auto-used fixture
* moved global mocking from test/__init__.py to conftest.py
* made `spack test` a wrapper around pytest
* run-unit-tests: avoid running python 2.6 tests under coverage to speed them up
* use `pytest --cov` instead of coverage run to cut down testing time
* mock/packages_test: moved mock yaml configuration to files instead of leaving it in the code as string literals
* concretize.py: ported tests to native pytest, reverted multiprocessing in pytest.ini as it was creating the wrong report for coveralls
* conftest.py, fixtures: added docstrings
* concretize_preferences.py: uses fixtures instead of subclassing MockPackagesTest
* directory_layout.py: uses fixtures instead of subclassing MockPackagesTest
* install.py: uses fixtures instead of subclassing MockPackagesTest
* optional_deps.py: uses fixtures instead of subclassing MockPackagesTest
optional_deps.py: uses fixtures instead of subclassing MockPackagesTest
* packages.py: uses fixtures instead of subclassing MockPackagesTest
* provider_index.py: uses fixtures instead of subclassing MockPackagesTest
* spec_yaml.py: uses fixtures instead of subclassing MockPackagesTest
* multimethod.py: uses fixtures instead of subclassing MockPackagesTest
* install.py: now uses mock_archive_url
* git_fetch.py: uses fixtures instead of subclassing MockPackagesTest
* hg_fetch.py: uses fixtures instead of subclassing MockPackagesTest
* svn_fetch.py, mirror.py: uses fixtures instead of subclassing MockPackagesTest
repo.py: deleted
* test_compiler_cmd.py: uses fixtures instead of subclassing MockPackagesTest
* cmd/module.py, cmd/uninstall.py: uses fixtures instead of subclassing MockDatabase
* database.py: uses fixtures instead of subclassing MockDatabase, removed mock/database
* pytest: uncluttering fixture implementations
* database: changing the scope to 'module'
* config.py: uses fixtures instead of subclassing MockPackagesTest
* spec_dag.py, spec_semantics.py: uses fixtures instead of subclassing MockPackagesTest
* stage.py: uses fixtures instead of subclassing MockPackagesTest. Removed mock directory
* pytest: added docstrings to all the fixtures
* pytest: final cleanup
* build_system_guess.py: fixed naming and docstrings as suggested by @scheibelp
* spec_syntax.py: added expected failure on parsing multiple specs closes #1976
* Add pytest and pytest-cov to Spack externals.
* Make `spack flake8` ignore externals.
* run-unit-tests runs spack test and not pytest.
* Remove all the special stuff for `spack test`
- Remove `conftest.py` magic and all the special case stuff in `bin/spack`
- Spack commands can optionally take unknown arguments, if they want to
handle them.
- `spack test` is now a command like the others.
- `spack test` now just delegates its arguments to `pytest`, but it does
it by receiving unknown arguments and NOT taking an explicit
help argument.
* Fix error in fixtures.
* Improve `spack test` command a bit.
- Now supports an approximation of the old simple interface
- Also supports full pytest options if you want them.
* Use external coverage instead of pytest-cov
* Make coverage use parallel-mode.
* change __init__.py docs to include pytest
2016-12-29 16:48:48 +01:00
|
|
|
- pip install --upgrade flake8
|
2018-06-26 13:32:32 -06:00
|
|
|
- pip install --upgrade pep8-naming
|
2018-09-02 21:22:06 -07:00
|
|
|
- if [[ "$TEST_SUITE" == "doc" ]]; then
|
|
|
|
pip install --upgrade -r lib/spack/docs/requirements.txt;
|
|
|
|
fi
|
2015-11-29 21:40:23 -08:00
|
|
|
|
2016-08-22 10:22:42 -05:00
|
|
|
before_script:
|
2015-11-29 21:40:23 -08:00
|
|
|
# Need this for the git tests to succeed.
|
|
|
|
- git config --global user.email "spack@example.com"
|
|
|
|
- git config --global user.name "Test User"
|
2016-05-10 23:45:41 -07:00
|
|
|
|
2016-01-19 18:29:39 +01:00
|
|
|
# Need this to be able to compute the list of changed files
|
2019-04-22 21:55:20 +09:00
|
|
|
- git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}
|
2015-11-29 21:40:23 -08:00
|
|
|
|
2016-12-30 13:59:21 -08:00
|
|
|
#=============================================================================
|
|
|
|
# Building
|
|
|
|
#=============================================================================
|
2018-01-11 03:41:19 +01:00
|
|
|
script:
|
|
|
|
- share/spack/qa/run-$TEST_SUITE-tests
|
2015-11-29 21:40:23 -08:00
|
|
|
|
2018-12-15 04:52:31 -05:00
|
|
|
after_success:
|
|
|
|
- ccache -s
|
2019-07-03 01:56:13 -07:00
|
|
|
- case "$TEST_SUITE" in
|
|
|
|
unit)
|
2019-08-06 19:35:23 +02:00
|
|
|
if [[ "$COVERAGE" == "true" ]]; then
|
|
|
|
codecov --env PYTHON_VERSION
|
|
|
|
--required
|
|
|
|
--flags "${TEST_SUITE}${TRAVIS_OS_NAME}";
|
|
|
|
fi
|
2019-07-03 01:56:13 -07:00
|
|
|
;;
|
2020-05-12 22:56:01 +02:00
|
|
|
shell)
|
|
|
|
codecov --env PYTHON_VERSION
|
|
|
|
--required
|
|
|
|
--flags "${TEST_SUITE}${TRAVIS_OS_NAME}";
|
2019-07-03 01:56:13 -07:00
|
|
|
esac
|
2018-12-15 04:52:31 -05:00
|
|
|
|
2016-12-30 13:59:21 -08:00
|
|
|
#=============================================================================
|
|
|
|
# Notifications
|
|
|
|
#=============================================================================
|
2015-11-29 21:40:23 -08:00
|
|
|
notifications:
|
|
|
|
email:
|
2020-04-28 14:55:44 +02:00
|
|
|
recipients:
|
|
|
|
- tgamblin@llnl.gov
|
|
|
|
- massimiliano.culpo@gmail.com
|
2015-11-29 21:40:23 -08:00
|
|
|
on_success: change
|
|
|
|
on_failure: always
|