[libvirt PATCH 0/2] ci: integration test tweaks

Daniel P. Berrangé (2): ci: rename integration test template ci: only run integration tests if $LIBVIRT_CI_INTEGRATION=1 is set ci/integration.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) -- 2.34.1

Although we split out jobs across many files, the template / job namespace is global, so we should use something more specific than '.tests' as the template name. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- ci/integration.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/integration.yml b/ci/integration.yml index 9a36ccc05e..2a6134924f 100644 --- a/ci/integration.yml +++ b/ci/integration.yml @@ -1,4 +1,4 @@ -.tests: +.integration_tests: stage: integration_tests before_script: - mkdir "$SCRATCH_DIR" @@ -43,7 +43,7 @@ centos-stream-8-tests: - extends: .tests + extends: .integration_tests needs: - x86_64-centos-stream-8 - project: libvirt/libvirt-perl @@ -57,7 +57,7 @@ centos-stream-8-tests: - redhat-vm-host centos-stream-9-tests: - extends: .tests + extends: .integration_tests needs: - x86_64-centos-stream-9 - project: libvirt/libvirt-perl @@ -71,7 +71,7 @@ centos-stream-9-tests: - redhat-vm-host fedora-34-tests: - extends: .tests + extends: .integration_tests needs: - x86_64-fedora-34 - project: libvirt/libvirt-perl @@ -85,7 +85,7 @@ fedora-34-tests: - redhat-vm-host fedora-35-tests: - extends: .tests + extends: .integration_tests needs: - x86_64-fedora-35 - project: libvirt/libvirt-perl -- 2.34.1

Right now the jobs have no rules so they will always be created in a pipeline. If the user's fork has no runner configured, then the jobs will never be able to execute and the pipeline will not finish. Even on upstream, there might be times the runner has to be taken offline for maint work, or unexpectedly fail. We need a quick way to disable the integration tests if we decide we don't want to have pipelines queued until the runner comes back online. Both these problems can be addressed by requiring a environment variable to be set LIBVIRT_CI_INTEGRATION=1 This can be done in the GitLab repo CI settings for permanent enablement. Alternatively it can be set for individual scheduled jobs, or using a push option git push -o ci.variable=LIBVIRT_CI_INTEGRATION=1 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- ci/integration.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/integration.yml b/ci/integration.yml index 2a6134924f..8551ce8776 100644 --- a/ci/integration.yml +++ b/ci/integration.yml @@ -40,6 +40,10 @@ paths: - logs when: on_failure + rules: + - if: '$LIBVIRT_CI_INTEGRATION' + when: on_success + - when: never centos-stream-8-tests: -- 2.34.1

On Thu, Mar 17, 2022 at 04:29:52PM +0000, Daniel P. Berrangé wrote:
Right now the jobs have no rules so they will always be created in a pipeline. If the user's fork has no runner configured, then the jobs will never be able to execute and the pipeline will not finish.
Even on upstream, there might be times the runner has to be taken offline for maint work, or unexpectedly fail. We need a quick way to disable the integration tests if we decide we don't want to have pipelines queued until the runner comes back online.
Both these problems can be addressed by requiring a environment variable to be set
LIBVIRT_CI_INTEGRATION=1
This can be done in the GitLab repo CI settings for permanent enablement. Alternatively it can be set for individual scheduled jobs, or using a push option
git push -o ci.variable=LIBVIRT_CI_INTEGRATION=1
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Reviewed-by: Erik Skultety <eskultet@redhat.com>

On Thu, Mar 17, 2022 at 04:29:50PM +0000, Daniel P. Berrangé wrote:
Daniel P. Berrangé (2): ci: rename integration test template ci: only run integration tests if $LIBVIRT_CI_INTEGRATION=1 is set
ci/integration.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
-- 2.34.1
Reviewed-by: Erik Skultety <eskultet@redhat.com> Sorry, when I sent my R-b to 2/2 yesterday I meant to give it to the whole series, I only noticed when I pulled master this morning. Regards, Erik
participants (2)
-
Daniel P. Berrangé
-
Erik Skultety