README.md revision 3ce85a5f5264e7118beb6524e120fd8b53a13da4
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
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovsuite under Valgrind, completing in under 5 minutes. Valgrind failures are
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovignored for now.
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
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovA sudo rule can be employed to selectively avoid password prompts on Red Hat
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdistros:
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov <USER> ALL=(ALL:ALL) NOPASSWD: /usr/bin/yum --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
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.