fedora-ci / mini-tps

Installability test for RPMs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mini TPS (installability)

This is a lightweight version of the TPS.

Installability test checks that given RPMs can be:

  • installed
  • removed
  • updated
  • downgraded

mini-tps has no external dependencies. The original TPS runs on Red Hat products, mini-tps was designed to be triggered early in the development process. It runs on Koji/Brew builds.

How to run it locally

You will need a VM and a Koji/Brew task id of the build that you want to test.

Run the following commands in the VM:

  1. Install mini-tps.
    dnf copr enable @osci/mini-tps
    dnf -y install mini-tps
  1. Prepare the system.
    mtps-prepare-system -p <profile-name>

See mtps-prepare-system --list for the list of available profiles.

  1. Fetch the Koji/Brew builds.
    mtps-get-task --createrepo --installrepofile --recursive --task=${TASK_ID} --download='/var/lib/brew-repo'
  1. Run the test. The valid tests are: install, remove, update, downgrade.
    mtps-run-tests --critical --selinux=1 --test=${test} --repo=brew-${TASK_ID}
  1. If you wish to test another package, remove /etc/yum.repos.d/brew-${TASK_ID}.repo and the files in /var/lib/brew-repo and repeat from the step 3.

See how the installability pipeline in fedora and RHEL do that:

Copr RPM builds

From a pull request

The .packit.yaml tells Packit to build RPMs from pull requests in Copr. RPMs from each PR are in a separate repository which you can enable to install the RPM.

For example, for PR#43 the repository is packit/fedora-ci-mini-tps-43 (might be already deleted). You can either run dnf copr enable packit/fedora-ci-mini-tps-43 or if you need a URL to the repo file then you can find it in the Repo Download on the Copr page.

From the main branch

Currently, we don't build automatically because there are no tests and an unnoticed push to main could silently break our RHEL/Fedora pipelines. To create a new build:

  • run rpmdev-bumpspec mini-tps.spec to bump the release in the spec file
  • run packit srpm --no-update-release to create a SRPM
  • Go to @osci/mini-tps New Build, select the SRPM file and hit Build

To enable the automatic builds, all you need to do is uncomment the copr_build job in the .packit.yaml.

Testing your change in a Jenkins pipeline

Mini-TPS is used in the installability pipeline in Fedora and RHEL. The way you can test a change from a (yet unmerged) pull request in those pipelines:

Fedora

  • Replace dnf -y copr enable @osci/mini-tps with dnf -y copr enable packit/fedora-ci-mini-tps-<PR-number> in prepare.sh and open a PR in the repo.
  • Once the PR appears in pipelines for PRs, submit Build with Parameters.

RHEL

  • Replace repo url with https://copr.fedorainfracloud.org/coprs/packit/fedora-ci-mini-tps-<PR-number>/repo/epel-${EPEL_VERSION} and open an MR in the repo.
  • Once the MR appears in pipelines for MRs, submit Build with Parameters.

About

Installability test for RPMs

License:GNU General Public License v2.0


Languages

Language:Shell 89.1%Language:Python 5.9%Language:HTML 5.0%