Skip to content
Snippets Groups Projects

Run tests using Koji RPMs

Merged Alex Iribarren requested to merge parallel into master
5 files
+ 55
57
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 11
30
@@ -54,11 +54,10 @@ variables, but you will have to specify the OS release yourself (ie. `KOJI_TAG_8
## Adding your own tests
This CI pipeline includes a `test` stage that is run after locally building the RPM,
before sending it off to Koji. There's a "base" test job called `.test_install` that
installs your locally built RPMs in the `before_script` section. This job is then extended by
OS-specific jobs (`test_install6`, `test_install7` or `test_install8`), which are the
ones actually executed.
This CI pipeline includes a `test` stage that is run after building the scratch RPM
on Koji. There's a "base" test job called `.test_install` that installs your RPMs
in the `before_script` section. This job is then extended by OS-specific jobs
(`test_install6`, `test_install7` or `test_install8`), which are the ones actually executed.
If you want to run extra actions (functional tests, etc.) once your RPMs are installed,
you can do so in the `script` section. You can add any necessary dependencies in the
@@ -77,7 +76,7 @@ Here are a few examples:
.test_install:
before_script:
- yum install -y --nogpgcheck --enablerepo=cernonly oracle-instantclient-tnsnames.ora
- yum install -y --nogpgcheck build/RPMS/*/*${DIST}*.rpm
- yum install -y --nogpgcheck koji/*${DIST}*.rpm
```
### Adding your own tag's repo (for extra dependencies)
@@ -93,7 +92,7 @@ be defined. The first two lines of the script should be included without modific
- yum install -y yum-utils yum-plugin-priorities
- yum-config-manager --add-repo "http://linuxsoft.cern.ch/internal/repos/${_KOJITAG}-stable/\$basearch/os"
- sed -i "s/\[.*\]/[${_KOJITAG}]\npriority=1/" /etc/yum.repos.d/linuxsoft.cern.ch*${_KOJITAG}*.repo
- yum install -y --nogpgcheck build/RPMS/*/*${DIST}*.rpm
- yum install -y --nogpgcheck koji/*${DIST}*.rpm
```
### New job with extra tests
@@ -111,7 +110,7 @@ test_nose6:
extends: test_install6
before_script:
- yum install -y python2-future
- yum install -y --nogpgcheck build/RPMS/*/*${DIST}*.rpm
- yum install -y --nogpgcheck koji/*${DIST}*.rpm
script:
# These deps are only needed to run the unit tests
- yum install --nogpgcheck -y python-nose python2-mock python-suds
@@ -126,7 +125,7 @@ You may not want to install all the RPMs that you've built:
```yaml
test_install7:
before_script:
- yum install -y --nogpgcheck build/RPMS/*/myrpm-client*.rpm
- yum install -y --nogpgcheck koji/myrpm-client*.rpm
```
### Ignoring rpmlint
@@ -149,28 +148,10 @@ test_rpmlint:
## Adding your own CI stages
There are some unused stages (`prebuild`, `pretest`, `posttest`, `postkoji`,
There are some unused stages (`prebuild`, `prekoji`, `pretest`, `posttest`, `postkoji`,
`docker_prepare` and `docker_build`) which you can use to define your own custom jobs.
If these are insufficient, or you wish to add/modify/reorder the stages of the CI process,
you will have to redefine the ones included in [rpm-ci.yml](https://gitlab.cern.ch/linuxsupport/rpmci/blob/master/rpm-ci.yml)
and add your own in your own `.gitlab-ci.yml` file.
```yaml
stages:
- prebuild
- srpm
- rpm
- koji_scratch
- pretest
- test
- posttest
- koji_build
- postkoji
- docker_prepare
- docker_build
- documentation
- deploy_qa
- deploy_stable
- victory_lap
```
and add your own in your own `.gitlab-ci.yml` file. Note, however, that there are
`dependencies` and `needs` clauses between some jobs that you may need to modify.
\ No newline at end of file
Loading