travis: use bionic as default for Linux (#16521)
Modifications: - [x] Travis now uses `bionic` as a default (`xenial` used for Python 3.5, `trusty` for Python 2.6) - [x] Shell unit tests have been factored into their own run - [x] `kcov` is built only for tests that upload coverage results Overall with this we shave 3-4 mins. on each run and add an additional run of about 3 min. For some reason `kcov` 38 fails forwarding output when used with Python unit tests, so I used v34 for that and v38 (latest) for shell testing. Previously we were using v25.
This commit is contained in:
parent
6b41fb88a9
commit
11fa61665f
3 changed files with 66 additions and 42 deletions
40
.travis.yml
40
.travis.yml
|
@ -12,7 +12,7 @@ branches:
|
||||||
# Build matrix
|
# Build matrix
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
dist: xenial
|
dist: bionic
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
@ -32,27 +32,22 @@ jobs:
|
||||||
# Everything but patchelf, that is not available for trusty
|
# Everything but patchelf, that is not available for trusty
|
||||||
packages:
|
packages:
|
||||||
- ccache
|
- ccache
|
||||||
- cmake
|
|
||||||
- gfortran
|
- gfortran
|
||||||
- graphviz
|
- graphviz
|
||||||
- gnupg2
|
- gnupg2
|
||||||
- kcov
|
- kcov
|
||||||
- mercurial
|
- mercurial
|
||||||
- ninja-build
|
- ninja-build
|
||||||
- perl
|
|
||||||
- perl-base
|
|
||||||
- realpath
|
- realpath
|
||||||
- r-base
|
|
||||||
- r-base-core
|
|
||||||
- r-base-dev
|
|
||||||
- zsh
|
- zsh
|
||||||
env: [ TEST_SUITE=unit, COVERAGE=true ]
|
env: [ TEST_SUITE=unit, COVERAGE=true ]
|
||||||
- python: '2.7'
|
- python: '2.7'
|
||||||
os: linux
|
os: linux
|
||||||
language: python
|
language: python
|
||||||
env: [ TEST_SUITE=unit, COVERAGE=true ]
|
env: [ TEST_SUITE=unit, COVERAGE=true, KCOV_VERSION=34 ]
|
||||||
- python: '3.5'
|
- python: '3.5'
|
||||||
os: linux
|
os: linux
|
||||||
|
dist: xenial
|
||||||
language: python
|
language: python
|
||||||
env: TEST_SUITE=unit
|
env: TEST_SUITE=unit
|
||||||
- python: '3.6'
|
- python: '3.6'
|
||||||
|
@ -66,7 +61,11 @@ jobs:
|
||||||
- python: '3.8'
|
- python: '3.8'
|
||||||
os: linux
|
os: linux
|
||||||
language: python
|
language: python
|
||||||
env: [ TEST_SUITE=unit, COVERAGE=true ]
|
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 ]
|
||||||
- python: '3.8'
|
- python: '3.8'
|
||||||
os: linux
|
os: linux
|
||||||
language: python
|
language: python
|
||||||
|
@ -87,20 +86,13 @@ addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- ccache
|
- ccache
|
||||||
- cmake
|
- coreutils
|
||||||
- gfortran
|
- gfortran
|
||||||
- graphviz
|
- graphviz
|
||||||
- gnupg2
|
- gnupg2
|
||||||
- kcov
|
|
||||||
- mercurial
|
- mercurial
|
||||||
- ninja-build
|
- ninja-build
|
||||||
- patchelf
|
- patchelf
|
||||||
- perl
|
|
||||||
- perl-base
|
|
||||||
- realpath
|
|
||||||
- r-base
|
|
||||||
- r-base-core
|
|
||||||
- r-base-dev
|
|
||||||
- zsh
|
- zsh
|
||||||
update: true
|
update: true
|
||||||
|
|
||||||
|
@ -114,6 +106,16 @@ cache:
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- ccache -M 2G && ccache -z
|
- ccache -M 2G && ccache -z
|
||||||
|
# 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
|
||||||
|
|
||||||
# Install various dependencies
|
# Install various dependencies
|
||||||
install:
|
install:
|
||||||
|
@ -151,6 +153,10 @@ after_success:
|
||||||
--flags "${TEST_SUITE}${TRAVIS_OS_NAME}";
|
--flags "${TEST_SUITE}${TRAVIS_OS_NAME}";
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
shell)
|
||||||
|
codecov --env PYTHON_VERSION
|
||||||
|
--required
|
||||||
|
--flags "${TEST_SUITE}${TRAVIS_OS_NAME}";
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
43
share/spack/qa/run-shell-tests
Executable file
43
share/spack/qa/run-shell-tests
Executable file
|
@ -0,0 +1,43 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
#
|
||||||
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||||
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Description:
|
||||||
|
# Runs Spack shell tests.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# run-shell-tests
|
||||||
|
|
||||||
|
#-----------------------------------------------------------
|
||||||
|
# Run a few initial commands and set up test environment
|
||||||
|
#-----------------------------------------------------------
|
||||||
|
ORIGINAL_PATH="$PATH"
|
||||||
|
|
||||||
|
. "$(dirname $0)/setup.sh"
|
||||||
|
check_dependencies $coverage git hg svn
|
||||||
|
|
||||||
|
# Clean the environment by removing Spack from the path and getting rid of
|
||||||
|
# the spack shell function
|
||||||
|
export PATH="$ORIGINAL_PATH"
|
||||||
|
unset spack
|
||||||
|
|
||||||
|
# Start in the spack root directory
|
||||||
|
cd "$SPACK_ROOT"
|
||||||
|
|
||||||
|
# Run bash tests with coverage enabled, but pipe output to /dev/null
|
||||||
|
# because it seems that kcov seems to undo the script's redirection
|
||||||
|
if [ "$COVERAGE" = true ]; then
|
||||||
|
"$QA_DIR/bashcov" "$QA_DIR/setup-env-test.sh" &> /dev/null
|
||||||
|
"$QA_DIR/bashcov" "$QA_DIR/completion-test.sh" &> /dev/null
|
||||||
|
else
|
||||||
|
bash "$QA_DIR/setup-env-test.sh"
|
||||||
|
bash "$QA_DIR/completion-test.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run the test scripts for their output (these will print nicely)
|
||||||
|
zsh "$QA_DIR/setup-env-test.sh"
|
||||||
|
dash "$QA_DIR/setup-env-test.sh"
|
|
@ -47,28 +47,3 @@ fi
|
||||||
# Run unit tests with code coverage
|
# Run unit tests with code coverage
|
||||||
#-----------------------------------------------------------
|
#-----------------------------------------------------------
|
||||||
$coverage_run $(which spack) test -x --verbose
|
$coverage_run $(which spack) test -x --verbose
|
||||||
|
|
||||||
#-----------------------------------------------------------
|
|
||||||
# Run tests for setup-env.sh
|
|
||||||
#-----------------------------------------------------------
|
|
||||||
# Clean the environment by removing Spack from the path and getting rid of
|
|
||||||
# the spack shell function
|
|
||||||
export PATH="$ORIGINAL_PATH"
|
|
||||||
unset spack
|
|
||||||
|
|
||||||
# start in the spack root directory
|
|
||||||
cd "$SPACK_ROOT"
|
|
||||||
|
|
||||||
# Run bash tests with coverage enabled, but pipe output to /dev/null
|
|
||||||
# because it seems that kcov seems to undo the script's redirection
|
|
||||||
if [ "$BASH_COVERAGE" = true ]; then
|
|
||||||
"$QA_DIR/bashcov" "$QA_DIR/setup-env-test.sh" &> /dev/null
|
|
||||||
"$QA_DIR/bashcov" "$QA_DIR/completion-test.sh" &> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
# run the test scripts for their output (these will print nicely)
|
|
||||||
bash "$QA_DIR/setup-env-test.sh"
|
|
||||||
zsh "$QA_DIR/setup-env-test.sh"
|
|
||||||
dash "$QA_DIR/setup-env-test.sh"
|
|
||||||
|
|
||||||
bash "$QA_DIR/completion-test.sh"
|
|
||||||
|
|
Loading…
Reference in a new issue