2016-12-30 21:59:21 +00:00
|
|
|
#=============================================================================
|
|
|
|
# Project settings
|
|
|
|
#=============================================================================
|
2016-10-28 20:26:20 +00:00
|
|
|
# Only build master and develop on push; do not build every branch.
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- develop
|
2017-01-16 02:45:38 +00:00
|
|
|
- /^releases\/.*$/
|
2016-10-28 20:26:20 +00:00
|
|
|
|
2016-12-30 21:59:21 +00:00
|
|
|
#=============================================================================
|
|
|
|
# Build matrix
|
|
|
|
#=============================================================================
|
2017-08-19 21:52:27 +00:00
|
|
|
jobs:
|
2017-02-11 02:21:52 +00:00
|
|
|
fast_finish: true
|
2016-12-30 21:59:21 +00:00
|
|
|
include:
|
2017-08-19 21:52:27 +00:00
|
|
|
- stage: 'flake8'
|
|
|
|
python: '2.7'
|
2017-01-26 10:19:35 +00:00
|
|
|
os: linux
|
|
|
|
language: python
|
2017-08-19 21:52:27 +00:00
|
|
|
env: TEST_SUITE=flake8
|
|
|
|
- stage: 'unit tests + documentation'
|
|
|
|
python: '2.6'
|
2017-01-26 10:19:35 +00:00
|
|
|
os: linux
|
|
|
|
language: python
|
2017-08-19 21:52:27 +00:00
|
|
|
env: TEST_SUITE=unit
|
2017-04-27 18:47:56 +00:00
|
|
|
- python: '2.7'
|
|
|
|
os: linux
|
|
|
|
language: python
|
2017-08-19 21:52:27 +00:00
|
|
|
env: [ TEST_SUITE=unit, COVERAGE=true ]
|
2017-03-27 01:02:56 +00:00
|
|
|
- python: '3.3'
|
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: TEST_SUITE=unit
|
|
|
|
- python: '3.4'
|
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: TEST_SUITE=unit
|
|
|
|
- python: '3.5'
|
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: TEST_SUITE=unit
|
|
|
|
- python: '3.6'
|
|
|
|
os: linux
|
|
|
|
language: python
|
2017-04-27 18:47:56 +00:00
|
|
|
env: [ TEST_SUITE=unit, COVERAGE=true ]
|
2017-08-19 21:52:27 +00:00
|
|
|
- os: osx
|
|
|
|
language: generic
|
|
|
|
env: [ TEST_SUITE=unit, PYTHON_VERSION=2.7, COVERAGE=true ]
|
|
|
|
- python: '2.7'
|
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: TEST_SUITE=doc
|
|
|
|
# mpich (AutotoolsPackage)
|
|
|
|
- stage: 'build tests'
|
|
|
|
python: '2.7'
|
2017-04-27 18:47:56 +00:00
|
|
|
os: linux
|
|
|
|
language: python
|
2017-08-19 21:52:27 +00:00
|
|
|
env: [ TEST_SUITE=build, COVERAGE=true, 'SPEC=mpich' ]
|
|
|
|
# astyle (MakefilePackage)
|
2017-01-26 10:19:35 +00:00
|
|
|
- python: '2.7'
|
|
|
|
os: linux
|
|
|
|
language: python
|
2017-08-19 21:52:27 +00:00
|
|
|
env: [ TEST_SUITE=build, COVERAGE=true, 'SPEC=astyle' ]
|
|
|
|
# tut (WafPackage)
|
2017-01-26 10:19:35 +00:00
|
|
|
- python: '2.7'
|
|
|
|
os: linux
|
|
|
|
language: python
|
2017-08-19 21:52:27 +00:00
|
|
|
env: [ TEST_SUITE=build, COVERAGE=true, 'SPEC=tut' ]
|
|
|
|
# py-setuptools (PythonPackage)
|
|
|
|
- python: '2.7'
|
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: [ TEST_SUITE=build, COVERAGE=true, 'SPEC=py-setuptools' ]
|
|
|
|
# perl-dbi (PerlPackage)
|
|
|
|
# - python: '2.7'
|
|
|
|
# os: linux
|
|
|
|
# language: python
|
|
|
|
# env: [ TEST_SUITE=build, COVERAGE=true, 'SPEC=perl-dbi' ]
|
|
|
|
# openjpeg (CMakePackage + external cmake)
|
|
|
|
- python: '2.7'
|
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: [ TEST_SUITE=build, COVERAGE=true, 'SPEC=openjpeg' ]
|
|
|
|
# r-rcpp (RPackage + external R)
|
|
|
|
- python: '2.7'
|
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: [ TEST_SUITE=build, COVERAGE=true, 'SPEC=r-rcpp' ]
|
|
|
|
# mpich (AutotoolsPackage)
|
|
|
|
- python: '3.6'
|
|
|
|
os: linux
|
|
|
|
language: python
|
|
|
|
env: [ TEST_SUITE=build, COVERAGE=true, 'SPEC=mpich' ]
|
2015-11-30 05:40:23 +00:00
|
|
|
|
2016-12-30 21:59:21 +00:00
|
|
|
#=============================================================================
|
|
|
|
# Environment
|
|
|
|
#=============================================================================
|
2015-11-30 06:09:11 +00:00
|
|
|
# Use new Travis infrastructure (Docker can't sudo yet)
|
|
|
|
sudo: false
|
|
|
|
|
2016-08-31 03:07:21 +00:00
|
|
|
# Docs need graphviz to build
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
2016-12-30 21:53:30 +00:00
|
|
|
- gfortran
|
2017-03-27 01:02:56 +00:00
|
|
|
- mercurial
|
2016-08-31 03:07:21 +00:00
|
|
|
- graphviz
|
2017-05-26 17:31:04 +00:00
|
|
|
- gnupg2
|
2017-08-19 21:52:27 +00:00
|
|
|
- cmake
|
|
|
|
- r-base
|
|
|
|
- r-base-core
|
|
|
|
- r-base-dev
|
|
|
|
- perl
|
|
|
|
- perl-base
|
|
|
|
|
|
|
|
cache: pip
|
2016-08-31 03:07:21 +00:00
|
|
|
|
2016-12-30 21:59:21 +00:00
|
|
|
# Work around Travis's lack of support for Python on OSX
|
|
|
|
before_install:
|
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
|
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew ls --versions python > /dev/null || brew install python; fi
|
2017-11-29 19:33:00 +00:00
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm /usr/local/include/c++ ; fi
|
2016-12-30 21:59:21 +00:00
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew ls --versions gcc > /dev/null || brew install gcc; fi
|
2017-05-26 17:31:04 +00:00
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew ls --versions gnupg2 > /dev/null || brew install gnupg2; fi
|
2016-12-30 21:59:21 +00:00
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then virtualenv venv; fi
|
|
|
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source venv/bin/activate; fi
|
|
|
|
|
2016-08-22 15:22:42 +00:00
|
|
|
# Install various dependencies
|
2016-01-19 17:29:39 +00:00
|
|
|
install:
|
2017-05-09 18:59:59 +00:00
|
|
|
- pip install --upgrade pip
|
2017-06-01 12:42:33 +00:00
|
|
|
- pip install --upgrade six
|
2017-05-09 18:59:59 +00:00
|
|
|
- pip install --upgrade setuptools
|
2017-01-26 10:19:35 +00:00
|
|
|
- pip install --upgrade codecov
|
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 15:48:48 +00:00
|
|
|
- pip install --upgrade flake8
|
2017-05-18 01:45:03 +00:00
|
|
|
- if [[ "$TEST_SUITE" == "doc" ]]; then pip install --upgrade -r lib/spack/docs/requirements.txt; fi
|
2015-11-30 05:40:23 +00:00
|
|
|
|
2016-08-22 15:22:42 +00:00
|
|
|
before_script:
|
2015-11-30 05:40:23 +00: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-11 06:45:41 +00:00
|
|
|
|
2016-01-19 17:29:39 +00:00
|
|
|
# Need this to be able to compute the list of changed files
|
|
|
|
- git fetch origin develop:develop
|
2015-11-30 05:40:23 +00:00
|
|
|
|
2017-08-19 21:52:27 +00:00
|
|
|
# Set up external dependencies for build tests, because the take too long to compile
|
|
|
|
- if [[ "$TEST_SUITE" == "build" ]]; then cp share/spack/qa/configuration/packages.yaml etc/spack/packages.yaml; fi
|
|
|
|
|
2016-12-30 21:59:21 +00:00
|
|
|
#=============================================================================
|
|
|
|
# Building
|
|
|
|
#=============================================================================
|
2016-08-22 15:22:42 +00:00
|
|
|
script: share/spack/qa/run-$TEST_SUITE-tests
|
2016-01-19 17:29:39 +00:00
|
|
|
|
|
|
|
after_success:
|
2017-04-22 00:41:30 +00:00
|
|
|
- codecov --env PY_VERSION
|
2015-11-30 05:40:23 +00:00
|
|
|
|
2016-12-30 21:59:21 +00:00
|
|
|
#=============================================================================
|
|
|
|
# Notifications
|
|
|
|
#=============================================================================
|
2015-11-30 05:40:23 +00:00
|
|
|
notifications:
|
|
|
|
email:
|
2016-08-22 15:22:42 +00:00
|
|
|
recipients: tgamblin@llnl.gov
|
2015-11-30 05:40:23 +00:00
|
|
|
on_success: change
|
|
|
|
on_failure: always
|