Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing Travis CI on Mac #4086

Merged
merged 5 commits into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ os:
- linux
- osx

osx_image: xcode8

group: deprecated-2017Q4
osx_image: xcode9.3

# Use Build Matrix to do lint and build seperately
env:
Expand Down Expand Up @@ -68,6 +66,10 @@ addons:
- g++-4.8
- gcc-7
- g++-7
homebrew:
packages:
- graphviz
update: true

before_install:
- source dmlc-core/scripts/travis/travis_setup_env.sh
Expand Down
26 changes: 5 additions & 21 deletions tests/travis/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@ if [ ${TASK} == "lint" ]; then
(cat logclean.txt|grep warning) && exit -1
(cat logclean.txt|grep error) && exit -1

# Rename cuda files for static analysis
for file in $(find src -name '*.cu'); do
cp "$file" "${file/.cu/_tmp.cc}"
done

echo "Running clang tidy..."
header_filter='(xgboost\/src|xgboost\/include)'
for filename in $(find src -name '*.cc'); do
clang-tidy $filename -header-filter=$header_filter -- -Iinclude -Idmlc-core/include -Irabit/include -std=c++11 >> logtidy.txt
done

echo "---------clang-tidy failures----------"
# Fail only on warnings related to XGBoost source files
(cat logtidy.txt|grep -E 'xgboost.*warning'|grep -v dmlc-core) && exit -1
echo "----------------------------"

if grep -R '<regex>' src include tests/cpp plugin jvm-packages amalgamation; then
echo 'Do not use std::regex, since it is not supported by GCC 4.8.x'
exit -1
Expand Down Expand Up @@ -62,15 +46,15 @@ if [ ${TASK} == "python_test" ]; then
python -m pip install datatable --no-binary datatable

python -m pip install graphviz pytest pytest-cov codecov
py.test -v --fulltrace -s tests/python --cov=python-package/xgboost || exit -1
python -m pytest -v --fulltrace -s tests/python --cov=python-package/xgboost || exit -1
codecov

source activate python2
echo "-------------------------------"
python --version
conda install numpy scipy pandas matplotlib scikit-learn
python -m pip install graphviz
py.test -v --fulltrace -s tests/python || exit -1
python -m pip install graphviz pytest
python -m pytest -v --fulltrace -s tests/python || exit -1
exit 0
fi

Expand All @@ -82,7 +66,7 @@ if [ ${TASK} == "python_lightweight_test" ]; then
python --version
conda install numpy scipy
python -m pip install graphviz pytest pytest-cov codecov
py.test -v --fulltrace -s tests/python --cov=python-package/xgboost || exit -1
python -m pytest -v --fulltrace -s tests/python --cov=python-package/xgboost || exit -1
codecov

source activate python2
Expand All @@ -91,7 +75,7 @@ if [ ${TASK} == "python_lightweight_test" ]; then
conda install numpy scipy pytest
python -m pip install graphviz
python -m pip install flake8==3.4.1
py.test -v --fulltrace -s tests/python || exit -1
python -m pytest -v --fulltrace -s tests/python || exit -1

flake8 --ignore E501 python-package || exit -1
flake8 --ignore E501 tests/python || exit -1
Expand Down
5 changes: 0 additions & 5 deletions tests/travis/setup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/bin/bash

if [ ${TRAVIS_OS_NAME} == "osx" ]; then
brew update
brew install graphviz
fi

if [ ${TASK} == "lint" ]; then
pip install --user cpplint 'pylint==1.4.4' 'astroid==1.3.6'
fi
Expand Down