Skip to content
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
- DISTRIB="conda" PYTHON_VERSION="3.6" EXAMPLES="true" SKLEARN_VERSION="0.18.2"
- DISTRIB="conda" PYTHON_VERSION="3.6" DOCTEST="true" SKLEARN_VERSION="0.18.2"
# - DISTRIB="conda" PYTHON_VERSION="3.7" SKLEARN_VERSION="0.18.2"
- DISTRIB="conda" PYTHON_VERSION="3.6" SKLEARN_VERSION="0.18.2" RUN_FLAKE8="true" SKIP_TESTS="true"

install: source ci_scripts/install.sh
script: bash ci_scripts/test.sh
Expand Down
3 changes: 3 additions & 0 deletions ci_scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ fi
if [[ "$COVERAGE" == "true" ]]; then
pip install codecov pytest-cov
fi
if [[ "$RUN_FLAKE8" == "true" ]]; then
pip install flake8
fi

python --version
python -c "import numpy; print('numpy %s' % numpy.__version__)"
Expand Down
43 changes: 26 additions & 17 deletions ci_scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
set -e

# Get into a temp directory to run test from the installed scikit learn and
# check if we do not leave artifacts
mkdir -p $TEST_DIR
run_tests() {
# Get into a temp directory to run test from the installed scikit learn and
# check if we do not leave artifacts
mkdir -p $TEST_DIR

cwd=`pwd`
test_dir=$cwd/tests
doctest_dir=$cwd/doc
cwd=`pwd`
test_dir=$cwd/tests
doctest_dir=$cwd/doc

cd $TEST_DIR
cd $TEST_DIR
if [[ "$EXAMPLES" == "true" ]]; then
pytest -sv $test_dir/test_examples/
elif [[ "$DOCTEST" == "true" ]]; then
python -m doctest $doctest_dir/usage.rst
fi

if [[ "$EXAMPLES" == "true" ]]; then
pytest -sv $test_dir/test_examples/
elif [[ "$DOCTEST" == "true" ]]; then
python -m doctest $doctest_dir/usage.rst
fi
if [[ "$COVERAGE" == "true" ]]; then
PYTEST_ARGS='--cov=openml'
else
PYTEST_ARGS=''
fi

pytest -n 4 --timeout=600 --timeout-method=thread -sv --ignore='test_OpenMLDemo.py' $PYTEST_ARGS $test_dir
}

if [[ "$COVERAGE" == "true" ]]; then
PYTEST_ARGS='--cov=openml'
else
PYTEST_ARGS=''
if [[ "$RUN_FLAKE8" == "true" ]]; then
source ci_scripts/flake8_diff.sh
fi

pytest -n 4 --timeout=600 --timeout-method=thread -sv --ignore='test_OpenMLDemo.py' $PYTEST_ARGS $test_dir
if [[ "$SKIP_TESTS" != "true" ]]; then
run_tests
fi