3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovContinuous integration
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov======================
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovThe executables and modules in this directory implement continuous integration
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov(CI) tests, which can be run to verify SSSD code quality and validity.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovSupported host distros are Fedora 20 and later, RHEL 6.5 and later, and Debian
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovTesting.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovThe tests are executed by running `contrib/ci/run` from the source tree root.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovIt accepts options to choose from three test sets: "essential", "moderate" and
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov"rigorous" (-e/-m/-r), with the essential set selected by default.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovEssential tests include building everything and running the built-in test
d9666fa22117f016b2b9c6640563a983b8e4c64eNikolai Kondrashovsuite under Valgrind, completing in under 5 minutes.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovModerate tests include essential tests, plus a distcheck target build and mock
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovpackage builds for Fedora and RHEL on Red Hat distros. They complete in about
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov15 minutes.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovRigorous tests include moderate tests, plus a pass with Clang static analyzer
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovover the whole build and test execution with code coverage collection and
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovverification, completing in 30 minutes. Static analyzer failures are ignored
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfor now.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovUse `contrib/ci/clean` to remove test results from the source tree.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovSetup
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov-----
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovCI requires `lsb_release` command to be available in order to determine host
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdistro version. On Red Hat distros it is contained in the `redhat-lsb-core`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovpackage and on Debian in `lsb-release`.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovThe rest of the required packages CI will attempt to install itself, using
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovthe distribution's package manager invoked through sudo.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
73585f9af928913200999c5b3b983bb9266ee266Lukas SlebodnikA sudo rule can be employed to selectively avoid password prompts on RHEL
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdistros:
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov <USER> ALL=(ALL:ALL) NOPASSWD: /usr/bin/yum --assumeyes install -- *
73585f9af928913200999c5b3b983bb9266ee266Lukas Slebodnik
73585f9af928913200999c5b3b983bb9266ee266Lukas Slebodnikon Fedora distros:
73585f9af928913200999c5b3b983bb9266ee266Lukas Slebodnik
51c4da6e4941dfc5fca40bffa2248b9a77f139b2Lukas Slebodnik # With dnf >= 2.0
51c4da6e4941dfc5fca40bffa2248b9a77f139b2Lukas Slebodnik <USER> ALL=(ALL:ALL) NOPASSWD: /usr/bin/dnf --assumeyes --best --setopt=install_weak_deps=False install -- *
73585f9af928913200999c5b3b983bb9266ee266Lukas Slebodnik # We need to use yum-deprecated on Fedora because of BZ1215208.
73585f9af928913200999c5b3b983bb9266ee266Lukas Slebodnik <USER> ALL=(ALL:ALL) NOPASSWD: /usr/bin/yum-deprecated --assumeyes install -- *
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovand Debian-based distros:
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov <USER> ALL=(ALL:ALL) NOPASSWD: /usr/bin/apt-get --yes install -- *
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovWhere `<USER>` is the user invoking CI.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
cf37196dca93a8785c5a4e0af6e9a5053bff4e3aLukas SlebodnikYou may also want to allow passing DEBIAN_FRONTEND environment variable to
cf37196dca93a8785c5a4e0af6e9a5053bff4e3aLukas Slebodnikapt-get on Debian, so CI can request non-interactive package installation:
cf37196dca93a8785c5a4e0af6e9a5053bff4e3aLukas Slebodnik
cf37196dca93a8785c5a4e0af6e9a5053bff4e3aLukas Slebodnik Defaults!/usr/bin/apt-get env_keep += "DEBIAN_FRONTEND"
cf37196dca93a8785c5a4e0af6e9a5053bff4e3aLukas Slebodnik
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovOn Red Hat distros a repository carrying dependencies missing from some
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdistros needs to be added to yum configuration. See instructions on the
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov[Copr project page](http://copr-fe.cloud.fedoraproject.org/coprs/lslebodn/sssd-deps/).
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovThat repository is also automatically used by CI during mock builds.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovPackage installation can be disabled with the -n/--no-deps option, e.g. for
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovmanual dependency management, or for shaving off a few seconds of execution
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovtime, when dependency changes are not expected.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovOn Red Hat distros, where mock builds are ran, it is better to have the
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovinvoking user added to the `mock` group. Otherwise mock builds will be
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovexecuted through sudo.