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/build-gating.fmf b/build-gating.fmf new file mode 100644 index 0000000..f95335e --- /dev/null +++ b/build-gating.fmf @@ -0,0 +1,71 @@ +# +# Build/PR gating tests for python-lit +# +# Compatible with various LLVM 13 distributions: +# +# * Fedora (ursine packages) +# * Centos 9 stream (ursine packages) +# * RHEL-9 (ursine packages) +# * RHEL-8 (Red Hat module) +# * RHEL-7 (software collection) +# + +summary: python-lit tests for build/PR gating +adjust: + - because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR." + when: >- + trigger is defined + and trigger != commit + and trigger != build + enabled: false + + - because: "When testing SCL-ized LLVM, the collection must be enabled first" + environment+: + WITH_SCL: "scl enable llvm-toolset-13.0" + when: "collection == llvm-toolset-13.0" + - because: "When testing SCL-ized LLVM, the collection must be enabled first" + environment+: + WITH_SCL: "scl enable llvm-toolset-14.0" + when: "collection == llvm-toolset-14.0" + + # Unfortunately, TMT does not support more declarative approach, we need to run commands on our own. + - because: "On RHEL, CRB must be enabled to provide rarer packages" + when: >- + distro == rhel-9 + or distro == rhel-8 + prepare+: + - name: Enable CRB + how: shell + script: dnf config-manager --set-enabled rhel-CRB + + - because: "On CentOS, CRB must be enabled to provide rarer packages" + when: >- + distro == centos + prepare+: + - name: Enable CRB + how: shell + script: dnf config-manager --set-enabled crb + + # Unfortunately, TMT does not support more declarative approach, we need to run commands on our own. + - because: "On RHEL-7, EPEL must be enabled to provided rarer packages" + prepare+: + - name: Enable EPEL + how: shell + script: | + rpm -q epel-release || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + yum-config-manager --enable epel + when: distro == rhel-7 + +discover: + - name: python-lit-tests + how: fmf + - name: upstream-llvm-integration-testsuite + how: fmf + url: https://src.fedoraproject.org/tests/llvm.git + ref: main + test: integration-test-suite +execute: + how: tmt +provision: + hardware: + memory: ">= 4 GiB" diff --git a/sanity/main.fmf b/sanity/main.fmf new file mode 100644 index 0000000..0a488fa --- /dev/null +++ b/sanity/main.fmf @@ -0,0 +1,16 @@ +summary: Trivial sanity test +test: "$WITH_SCL ./test.sh" +require: [] +adjust: + # Common requirements when LLVM is not SCL-ized + - require+: + - python3-lit + when: "collection is not defined" + + # Requirements for SCL-ized LLVM + - require+: + - llvm-toolset-13.0-python3-lit + when: "collection == llvm-toolset-13.0" + - require+: + - llvm-toolset-14.0-python3-lit + when: "collection == llvm-toolset-14.0" diff --git a/sanity/test.sh b/sanity/test.sh new file mode 100755 index 0000000..a8aad72 --- /dev/null +++ b/sanity/test.sh @@ -0,0 +1,3 @@ +#! /bin/sh -eux + +lit --version