From 4f084b1141ff07cf91bbda92432a18664d3e7093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pl=C3=ADchal?= Date: Mon, 6 Nov 2023 13:02:08 +0100 Subject: [PATCH] Add an `adjust` example for enabling custom repo Let's add one more context adjust example demonstrating a real-life use case of enabling a custom dnf repository using the context dimension value for setting the repository url. --- spec/core/adjust.fmf | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/spec/core/adjust.fmf b/spec/core/adjust.fmf index 4d018881d0..852c708dff 100644 --- a/spec/core/adjust.fmf +++ b/spec/core/adjust.fmf @@ -47,20 +47,21 @@ description: | __ https://fmf.readthedocs.io/en/latest/context.html#syntax __ https://docs.fedoraproject.org/en-US/ci/test-case-relevancy -example: | +example: + - | # Disable a test for older distros enabled: true adjust: enabled: false when: distro < fedora-33 because: the feature was added in Fedora 33 - + - | # Adjust the required package name require: procps-ng adjust: - require: procps when: distro == centos-6 - + - | # Extend the environment variables, use multiple rules adjust: - environment+: @@ -69,7 +70,7 @@ example: | continue: true - when: distro < centos-6 enabled: false - + - | # Install the fresh pytest from pip on older distros adjust: prepare+: @@ -78,6 +79,20 @@ example: | order: 90 script: 'python3 -m pip install -U pytest' when: distro < rhel-8 + - | + # Enable a custom dnf repository based on the context value + adjust: + - when: repo is defined + prepare+: + - script: | + cat > /etc/yum.repos.d/custom-repo.repo <