run revision 9d453f1e8b28983b363b44c49b7cd701a994fd97
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Run continuous integration tests.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Copyright (C) 2014 Red Hat
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# This program is free software; you can redistribute it and/or modify
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# it under the terms of the GNU General Public License as published by
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# the Free Software Foundation; either version 3 of the License, or
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# (at your option) any later version.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# This program is distributed in the hope that it will be useful,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# but WITHOUT ANY WARRANTY; without even the implied warranty of
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# GNU General Public License for more details.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You should have received a copy of the GNU General Public License
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# along with this program. If not, see <http://www.gnu.org/licenses/>.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedeclare -r CI_DIR=`dirname "\`readlink -f \"\$0\"\`"`
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Minimum percentage of code lines covered by tests
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Minimum percentage of code functions covered by tests
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Output program usage information.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteUsage: `basename "$0"` [OPTION...]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteRun continuous integration tests.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -h, --help Output this help message and exit.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -p, --prefix=STRING Use STRING as the prefix to prepend to file and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte directory paths in output.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -n, --no-deps Don't attempt to install dependencies.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -e, --essential Run the essential subset of tests.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -m, --moderate Run the moderate subset of tests.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -r, --rigorous,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte -f, --full Run the rigorous (full) set of tests.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteDefault options: --essential
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Output a file display path: a path relocated from base directory (BASE_DIR)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# to base prefix (BASE_PFX).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Run a stage.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Args: id cmd [arg...]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Execute mock as is, or, if the user is not in the "mock" group, under sudo,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# which has password prompt/input on the console, instead of stderr/stdin.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Args: [mock_arg...]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte prompt+="To run mock enter sudo password for $USER: "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Execute mock_privileged with extra chroot configuration added.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Args: chroot [mock_arg...]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Input: extra configuration
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte conf_dir=`mktemp --tmpdir --directory mock-config.XXXXXXXX`
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # Preserve timestamps to avoid unnecessary cache rebuilds
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cp -r --preserve=timestamps /etc/mock/* "$conf_dir"/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte touch --reference="/etc/mock/${chroot}.cfg" "${conf_dir}/${chroot}.cfg"
4b31676f89e318c11400fc0c4defc802da29222fsrivijitha dugganapalli mock_privileged --configdir="$conf_dir" --root="$chroot" "$@"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Execute mock_privileged with dependency package source configuration added.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Args: chroot [mock_arg...]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte declare -r config=$(basename $(readlink -f "/etc/mock/${chroot_name}.cfg"))
86b7dbefda771542da92c8e031c0153fd809ff01Peter Gillconfig_opts['yum.conf'] += '''
86b7dbefda771542da92c8e031c0153fd809ff01Peter Gillname=Extra SSSD dependencies
86b7dbefda771542da92c8e031c0153fd809ff01Peter Gillbaseurl=http://copr-be.cloud.fedoraproject.org/results/lslebodn/sssd-deps/$repo/
86b7dbefda771542da92c8e031c0153fd809ff01Peter Gillskip_if_unavailable=true
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Run debug build checks.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # Not building "tests" due to https://fedorahosted.org/sssd/ticket/2350
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stage make-tests make-check-wrap -j $CPU_NUM check -- true
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stage make-intgcheck make -j $CPU_NUM intgcheck \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte test_dir_distcheck=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # Single thread due to https://fedorahosted.org/sssd/ticket/2354
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stage mock-build mock_privileged_deps "default" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Run coverage build checks.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte declare -r coverage_report_dir="ci-report-coverage"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # Not building "tests" due to https://fedorahosted.org/sssd/ticket/2350
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stage make-tests make-check-wrap -j $CPU_NUM check -- true
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stage lcov-pre lcov --capture --initial --directory . \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stage lcov-merge lcov --add-tracefile ci-base.info \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "$coverage_report_dir" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte --title "sssd" --show-details \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte --legend --prefix "$BASE_DIR" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte printf "%-$((TITLE_WIDTH + RESULT_WIDTH))s%s\n" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "`disppath \"\$coverage_report_dir/index.html\"`"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stage lcov-check eval 'lcov_check "$COVERAGE_MIN_LINES" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "$COVERAGE_MIN_FUNCS" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Run a build inside a sub-directory.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Args: id cmd [arg...]
--longoptions help,prefix:,no-deps \
eval set -- "$args_expr"
-h|--help)
-p|--prefix)
DEPS=false; shift;;
-e|--essential)
-m|--moderate)
if "$DEPS"; then
if "$RIGOROUS"; then
trap - EXIT
echo SUCCESS