From 379e23132d58a3b4d51d6056ef110b431acc1058 Mon Sep 17 00:00:00 2001 From: Patrik Koncity Date: Mon, 15 Jan 2024 10:36:51 +0100 Subject: [PATCH] Add upstream CI for test PR's to main branch Packit CI, can run test suite against incoming code changes to repository. CI can catch mistakes and failures in new code. Signed-off-by: Patrik Koncity --- .fmf/version | 1 + .packit.yaml | 13 +++++++++++++ plans/packit-ci.fmf | 47 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .fmf/version create mode 100644 .packit.yaml create mode 100644 plans/packit-ci.fmf diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..e702ca6 --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,13 @@ +--- +jobs: + - job: tests + trigger: pull_request + branch: main + targets: + - fedora-rawhide + skip_build: true + tf_extra_params: + environments: + - tmt: + context: + target_PR_branch: main diff --git a/plans/packit-ci.fmf b/plans/packit-ci.fmf new file mode 100644 index 0000000..0cf29ee --- /dev/null +++ b/plans/packit-ci.fmf @@ -0,0 +1,47 @@ +summary: common test plan for CI + + +prepare: + - how: shell + script: + - ln -s $(pwd) /var/tmp/attestation-operator_sources || true + - systemctl disable --now dnf-makecache.service || true + - systemctl disable --now dnf-makecache.timer || true + - dnf makecache + +environment: + OPERATOR_NAME: "keylime" + OPERATOR_NAMESPACE: "attestation-operator" + UPSTREAM_OPERATOR: "true" + REPO_CLONE: "attestation" + + +discover: + - name: Configure_test_system + how: fmf + url: https://github.com/RedHat-SP-Security/common-cloud-orchestration + ref: main + test: + - /Setup/setup_local_cluster + - /Setup/install_upstream_operator + #need to run bundle task, for now unstable + - name: Run_tests + how: fmf + url: https://github.com/RedHat-SP-Security/attestation-operator-tests + ref: main + test: + - /Setup/install_operator + - /Sanity + - /Setup/clean_cluster + +adjust: + - when: distro == rhel-9 or distro == centos-stream-9 + prepare+: + - how: shell + script: + - dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm + + +execute: + how: tmt +