{"id":24504146,"url":"https://github.com/rpm-software-management/ci-dnf-stack","last_synced_at":"2026-01-02T06:04:19.285Z","repository":{"id":32648796,"uuid":"36235901","full_name":"rpm-software-management/ci-dnf-stack","owner":"rpm-software-management","description":"CI tests for the dnf stack","archived":false,"fork":false,"pushed_at":"2024-04-12T06:40:04.000Z","size":19513,"stargazers_count":13,"open_issues_count":27,"forks_count":46,"subscribers_count":18,"default_branch":"main","last_synced_at":"2024-04-12T14:34:36.305Z","etag":null,"topics":["ci","dnf","tests"],"latest_commit_sha":null,"homepage":"","language":"Gherkin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rpm-software-management.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-05-25T14:32:45.000Z","updated_at":"2024-04-15T08:47:20.120Z","dependencies_parsed_at":"2024-01-29T12:59:25.118Z","dependency_job_id":"674da3bf-1477-4f1a-98d4-cfa526b9268d","html_url":"https://github.com/rpm-software-management/ci-dnf-stack","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpm-software-management%2Fci-dnf-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpm-software-management%2Fci-dnf-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpm-software-management%2Fci-dnf-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpm-software-management%2Fci-dnf-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rpm-software-management","download_url":"https://codeload.github.com/rpm-software-management/ci-dnf-stack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243704462,"owners_count":20334161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","dnf","tests"],"created_at":"2025-01-21T23:21:36.254Z","updated_at":"2026-01-02T06:04:14.257Z","avatar_url":"https://github.com/rpm-software-management.png","language":"Gherkin","funding_links":[],"categories":[],"sub_categories":[],"readme":"ci-dnf-stack\n============\n\nThis repository contains the integration test suite (a.k.a. the behave tests)\nof the DNF stack, along with tooling to run the suite in containers (which are\nused for sandboxing, some of the DNF tests are destructive to the system), and\nthe shared CI setup for DNF stack components.\n\nFor documentation of the integration test suite based on behave, see\n[`dnf-behave-tests/README.md`](dnf-behave-tests/README.md).\n\n\nRunning the Containerized Test Suite\n------------------------------------\n\nTo set up clean and sandboxed environment, the integration test suite is run in\ncontainers. The dockerfiles in the root directory are used to build the image\nin which the tests are run.\n\nFor destructive tests, each destructive scenario is run in its own container.\nFor non-destructive tests one container per feature file is run.\n\n### Building the Container Image to Run Tests\n\nBuild the container image for the tests:\n```\n./container-test build\n```\n\nYou can also quite simply run the tests on a different distribution than the\ndefault:\n```\n./container-test build --base quay.io/centos/centos:stream8\n```\n\nIf any additional repositories are needed to be added to the container image,\nyou can place them into the `repos.d` directory (mainly useful for RHEL).\n\nIf any additional CA certificates are needed to be trusted in the container\nimage, e.g. for the additional repositories, you can place them into the\n`ca-trust` directory.\n\nDuring the build, any RPMs found in the `rpms` directory are installed in the\nimage. Place your RPMs to be tested in this directory.\n\nBarring these, the latest versions of the DNF stack RPMs from the dnf-nightly\nCopr repository (see [Nightly Builds](#Nightly-Builds) below) are installed on\nthe system, unless you disable this via the `--type` argument (the value of\nthis argument should be whatever the `Dockerfile` supports, in this case\nanything other than `\"nightly\"` will do the job):\n```\n./container-test build --type distro\n```\n\nThe full integration test suite directory (`dnf-behave-tests`) is copied into\nthe image during the build.\n\n### Running the Tests\n\nRun the integration test suite in containers:\n```\n./container-test run\n```\n\nThe integration test suite actually contains two distinct test suites, `dnf`\n(default) and `createrepo_c`. To specify the suite, use the `-s` switch:\n```\n./container-test -s createrepo_c run\n```\n\nFor development, it is possible to dynamically mount the features directory of\nthe given suite by using the `-d` switch:\n```\n./container-test -s createrepo_c -d run\n```\n\nTo only run a subset of a suite, simply specify the feature files (this will\nrun scenarios in `dnf-behave-tests/dnf/config.feature`, as `dnf` is the\ndefault test suite):\n```\n./container-test run config.feature\n```\n\nFor documentation of the rest of the options of the script, use `--help`:\n```\n./container-test --help\n./container-test COMMAND --help\n```\n\n\nrpm-gitoverlay Overlays\n-----------------------\n\nThe [rpm-gitoverlay](https://github.com/rpm-software-management/rpm-gitoverlay)\ntool is used to build the DNF stack RPMs in Copr. You can find rpm-gitoverlay\nRPM packages in [its own Copr repository](https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/rpm-gitoverlay/).\nUse `dnf copr enable rpmsoftwaremanagement/rpm-gitoverlay` to add the\nrepository on your system.\n\nThe configurations for groups of packages to build can be found in the\n[`overlays`](overlays) directory.  As an example, assuming you have your [Copr\nAPI token configured](https://copr.fedorainfracloud.org/api/), you can build\nthe `dnf-ci` overlay (the stack of packages that is tested by the `dnf` test\nsuite) with this command:\n```\nrpm-gitoverlay -o rpmlist --gitdir=gits build-overlay -s overlays/dnf-ci rpm copr --owner YOUR_COPR_USERNAME --project my-test-build --chroot fedora-33-x86_64 --delete-project-after-days=2\n```\n\nWhere:\n- `-o rpmlist` will output the full list of built RPMs into the `rpmlist` file\n- `--gitdir=gits` specifies the directory to which rpm-gitoverlay will clone\n  the components' git repositories\n- `-s overlays/dnf-ci` specifies the path to the overlay to build\n- `--delete-project-after-days=2` will tell Copr to delete the project in two\n  days, meaning you don't have to clean up manually later\n\nYou can then download the built RPMs into the `rpms/` directory:\n```\nfor RPM in $(cat rpmlist); do wget -P rpms $RPM; done\n```\n\nAnd you're set to run the test suite on the RPMs.\n\nIn case you want to build some components of the stack with your changes,\nsimply set up your clone in `gits/COMPONENT` and run the above command. If\n`rpm-gitoverlay` finds an existing git repository for a component in the\n`--gitdir`, it will use it as-is.\n\n\nCI in Github Actions\n--------------------\n\nThe DNF stack CI is implemented in Github Actions. The code that makes up the\nCI is located in [`.github/workflows/`](.github/workflows/) in this repository\nas well as in all the stack component repositories. The CI workflow files are\nmostly the same across the repositories, and some of the code is shared between\nthem in form of actions, located in [`.github/actions/`](.github/actions/).\n\nThe bootstrap of the CI (on a Pull Request) in Github Actions for a repository\nin the stack is done in a bit unconventional way:\n\n1. The first git repository that is cloned is this, `ci-dnf-stack`. This then\nmakes the shared actions available to be called.\n\n2. Then, the Pull Request target repository is cloned into `gits/REPO` (the PR\nHEAD is checked out and subsequently rebased on the target branch to bring it\nup to date). This is then used directly by `rpm-gitoverlay`,\n[see above](#rpm-gitoverlay-overlays).\n\n### Workflow Host Image\n\nAll DNF stack CI workflows run on a base Fedora container image. Since we need\nsome additional tools installed, to save on installing these on a vanilla\nFedora image on every CI run, we create a daily host image and store it in\nGithub Container Registry. This is done in `.github/workflows/ci-host.yml`.\n\n### Setting Up the Workflows on a Fork\n\nFor the Github Actions workflows to work on a fork, you need two secrets\nconfigured on your Github repository:\n- `COPR_USER`: Your Copr username; Since Github Actions automatically scrub any\n  secret value from the workflow outputs (e.g. in Copr URLs in the log), there\n  is a workaround to avoid this on the username: append a `#` (bash comment\n  sign) to the end of the secret. It is dropped in a bash variable assignment\n  in the workflow and the username is no longer masked in the output.\n- `COPR_API_TOKEN`: The full contents of [Copr API\n  token](https://copr.fedorainfracloud.org/api/) meant to go into\n  `~/.config/copr`.\n\n\nNightly Builds\n--------------\n\nThe DNF stack nightlies are built via a Github Actions workflow:\n`.github/workflows/nightly.yml`.\n\nThe built nightlies can be found in the [rpmsoftwaremanagement\nCopr](https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf-nightly/).\n\n\nIntegration Tests of Users of the DNF Stack\n-------------------------------------------\n\nThe aim is to run integration tests of projects that depend on the DNF stack,\nso that regressions can be caught early and close to the source.\n\nSo far there's only the Ansible integration test suite (specifically its part\nthat concerns DNF) integrated into our CI.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpm-software-management%2Fci-dnf-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frpm-software-management%2Fci-dnf-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpm-software-management%2Fci-dnf-stack/lists"}