From 58367ffaa1e4a22e3ee9a52b6f80616fb54f2cf5 Mon Sep 17 00:00:00 2001 From: "Brad P. Crochet" Date: Thu, 2 Apr 2015 13:48:56 -0400 Subject: [PATCH] Add configuration for running unittests in jenkins with khaleesi Change-Id: Id62e877130c1d0967fe0c1736253149185678fcf --- jenkins-config.yml | 104 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 jenkins-config.yml diff --git a/jenkins-config.yml b/jenkins-config.yml new file mode 100644 index 000000000..fb323dc87 --- /dev/null +++ b/jenkins-config.yml @@ -0,0 +1,104 @@ +# This file is used by the jenkins job +# read: 'How it works' section at the bottom + + +### config template ### +# test_env: # top-level namespace used by khaleesi +# env_name: # test config +# Distro-Version: # test configuration for the distro-version +# | setup: # how the testbed VM needs to be setup +# | ' repos: # add the following repos +# | ' - filename: repo-name.repo +# | ' contents: | +# | ' [section] +# | ' contents +# | ' of +# | ' Repo +# +# | ' install: # install the following rpm and +# | ' - rpm-abc # ensure latest is installed +# | ' - rpm-foo +# | ' - rpm-bar +# +# | ' remove: # delete the following rpms +# | ' - rpm-foo +# | ' - rpm-bar +# | ' - rpm-baz +# | ' pip: # use virtualenv --system-site-packages to +# | ' overrides: # override system packages +# | ' - pip-pkg-foo +# | ' - pip-pkg-foo +# +# | run: > # how tests should be run +# | run_command; another_command; +# | ./run_tests.sh -N -P # all but last statement should terminated by ; +# +# | archive: # what files to archive +# | - nosetest.xml +# +# NOTE: there must be a env_name: called virt: which will be used to run tests +# in virtualenv when running tests in env_name fails + +product: + name: rhos + repo_type: poodle + version: 6.0 + config: + enable_epel: n + +python_rdomanager_oscplugin_rpm_deps: [ + gcc, git, python-sphinx, python-tox, python-pip, + python-rdomanager-oscplugin +] + +rdomanager_oscplugin_virt_config: + setup: + install: "{{python_rdomanager_oscplugin_rpm_deps}}" + run: > + sudo rm -Rf .tox || true; + sudo pip install -U unittest2; + export NOSE_WITH_XUNIT=1; + export NOSE_WITH_HTML_OUTPUT=1; + export NOSE_HTML_OUT_FILE=../logs/nose_results.html; + export NSS_HASH_ALG_SUPPORT=+MD5; + export OPENSSL_ENABLE_MD5_VERIFY=1; + sudo yum remove -y python-rdomanager-oscplugin; + truncate --size 0 requirements.txt; + rpm -qa > all-rpms.txt; + set -o pipefail; + tox --sitepackages -v -epy27 2>&1 | tee ../logs/venv-testrun.log; + archive: + - ../logs/venv-testrun.log + - tox.ini + - requirements.txt + - all-rpms.txt + +### actual test_config: starts here: used by khaleesi ### +### NOTE: test_config.virt must be defined ### +test_config: + virt: + Fedora-20: "{{rdomanager_oscplugin_virt_config}}" + RedHat-7.0: "{{rdomanager_oscplugin_virt_config}}" + RedHat-7.1: "{{rdomanager_oscplugin_virt_config}}" + +# How this works! +# ============== +# This file is used by khaleesi[1] playbook unit_test.yml[2]. +# - The jenkins job checks out khaleesi, settings and this repo and +# runs unit_test.yml playbook. +# - The playbook reads this config file and +# - adds repos in test_dependencies.rpm.repos +# - installs all packages in test_dependencies.rpm.install +# - removes all packages in test_dependencies.rpm.remove +# - it then runs the test by executing the command specfied in +# test_env.run NOTE all commands should terminate with a ';' +# - if tests fail, the same is run in venv with pip packages. +# +# PIP overrides +# ------------- +# When there is no corresponding rpm for a pip package, you can override that +# particular package using the pip.override section. When you do so, make sure +# the packaging team is notified about the new requirement. +# +# [1] https://github.com/redhat-openstack/khaleesi +# [2] https://github.com/redhat-openstack/khaleesi/blob/master/playbooks/unit_test.yml \ No newline at end of file