2016-12-20 08:55:55 -06:00
|
|
|
#!/bin/bash
|
2017-01-03 05:47:48 -06:00
|
|
|
#
|
|
|
|
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
|
|
|
|
#
|
2016-12-20 08:55:55 -06:00
|
|
|
# NOTE: this script is intended to run in Travis CI only
|
|
|
|
|
2016-12-21 03:16:47 -06:00
|
|
|
PYTHON="/usr/bin/python${TRAVIS_PYTHON_VERSION}"
|
2016-12-20 08:55:55 -06:00
|
|
|
test_set=""
|
|
|
|
developer_mode_opt="--developer-mode"
|
|
|
|
|
|
|
|
if [[ "$TASK_TO_RUN" == "lint" ]]
|
|
|
|
then
|
|
|
|
if [[ "$TRAVIS_EVENT_TYPE" == "pull_request" ]]
|
|
|
|
then
|
|
|
|
git diff origin/$TRAVIS_BRANCH -U0 | pep8 --diff &> $PEP8_ERROR_LOG ||:
|
|
|
|
fi
|
|
|
|
|
|
|
|
# disable developer mode for lint task, otherwise we get an error
|
|
|
|
developer_mode_opt=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -n "$TESTS_TO_RUN" ]]
|
|
|
|
then
|
|
|
|
pushd ipatests
|
|
|
|
test_set=`ls -d -1 $TESTS_TO_RUN 2> /dev/null | tr '\n' ' '`
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
|
|
|
docker pull $TEST_RUNNER_IMAGE
|
|
|
|
|
|
|
|
ipa-docker-test-runner -l $CI_RESULTS_LOG \
|
|
|
|
-c $TEST_RUNNER_CONFIG \
|
|
|
|
$developer_mode_opt \
|
2016-12-21 03:16:47 -06:00
|
|
|
--container-environment "PYTHON=$PYTHON" \
|
2016-12-20 08:55:55 -06:00
|
|
|
--container-image $TEST_RUNNER_IMAGE \
|
|
|
|
--git-repo $TRAVIS_BUILD_DIR \
|
|
|
|
$TASK_TO_RUN $test_set
|