From 5e9a5e4daa23bae848ddff76c6964e31f9f68e8f Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Tue, 23 Oct 2018 00:20:53 -0700 Subject: Fix macOS tests (#6437) * Don't try to install installed packages. * Test with any version of python3 on macOS. * move file and fix mode * ignore stderr too * remove extra set -e * no linux failures --- .travis.yml | 4 ++-- tests/travis-macos-setup.sh | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 tests/travis-macos-setup.sh diff --git a/.travis.yml b/.travis.yml index b0f533730..238f450cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: - cp .travis.yml /tmp/travis.yml - git pull origin master --strategy=recursive --strategy-option=theirs --no-edit - if ! git diff .travis.yml /tmp/travis.yml ; then echo "Please merge master into test-everything"; exit 1; fi - - '([ $TRAVIS_OS_NAME == linux ] && dpkg -s libaugeas0) || (brew update && brew install augeas && brew upgrade python python3 && brew link python)' + - '[ "$TRAVIS_OS_NAME" != osx ] || tests/travis-macos-setup.sh' before_script: - 'if [ $TRAVIS_OS_NAME = osx ] ; then ulimit -n 1024 ; fi' @@ -121,7 +121,7 @@ matrix: env: TOXENV=py27 os: osx - language: generic - env: TOXENV=py37 + env: TOXENV=py3 os: osx diff --git a/tests/travis-macos-setup.sh b/tests/travis-macos-setup.sh new file mode 100755 index 000000000..bf72f26a5 --- /dev/null +++ b/tests/travis-macos-setup.sh @@ -0,0 +1,17 @@ +#!/bin/bash -e +# +# Set up the test environment for macOS on Travis. + +# Install the given package with brew if it's not already installed. +brew_install() { + if ! brew list "$1" > /dev/null 2>&1; then + brew install "$1" + fi +} + +brew_install augeas +brew_install python +brew_install python3 + +# Ensure we use python from brew. +brew link python -- cgit v1.2.3