From ef8f1edd8edd481ff7f5f201b2bd1c73aee7b54b Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Mon, 31 Jan 2022 16:17:21 +0100 Subject: [PATCH] tests: re-use Fedora tests Related: rhbz#2001107 --- .fmf/version | 1 + tests/build-gating.fmf | 53 +++++++++++++++++++++++++ tests/integration-test-suite/runtest.sh | 38 ------------------ tests/tests.yml | 25 ------------ 4 files changed, 54 insertions(+), 63 deletions(-) create mode 100644 .fmf/version create mode 100644 tests/build-gating.fmf delete mode 100755 tests/integration-test-suite/runtest.sh delete mode 100644 tests/tests.yml 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/tests/build-gating.fmf b/tests/build-gating.fmf new file mode 100644 index 0000000..d689d8e --- /dev/null +++ b/tests/build-gating.fmf @@ -0,0 +1,53 @@ +# +# Build/PR gating tests for *LLVM 13* +# +# Imports and runs tests provided by Fedora LLVM git for the matching LLVM version. +# +# NOTE: *always* keep this file in sync with upstream, i.e. Fedora. Since we cannot "discover" a plan, +# we must duplicate at least some part of upstream plan setup, like `adjust` or `provision`. Not necessarily +# all steps, but if we do need some of them here, let's focus on making changes in upstream first, to preserve +# one source of truth. Once TMT learns to include whole plans, we could drop the copied content from here. +# + +summary: libomp 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 + + # 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 + +discover: + - name: libomp-upstream-tests + how: fmf + url: https://src.fedoraproject.org/rpms/libomp.git + ref: rawhide + - name: upstream-llvm-integration-testsuite + how: fmf + url: https://src.fedoraproject.org/rpms/llvm.git + ref: rawhide + test: integration-test-suite +execute: + how: tmt +provision: + hardware: + memory: ">= 4 GiB" \ No newline at end of file diff --git a/tests/integration-test-suite/runtest.sh b/tests/integration-test-suite/runtest.sh deleted file mode 100755 index 1af4e4a..0000000 --- a/tests/integration-test-suite/runtest.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -usage() { - echo "usage `basename $0` [OPTIONS]" - echo " --threads NUM The number of threads to use for running tests." -} - -thread_args="" -repo_url=https://github.com/opencollab/llvm-toolchain-integration-test-suite - -while [ $# -gt 0 ]; do - case $1 in - --threads) - shift - threads="$1" - ;; - * ) - echo "unknown option: $1" - echo "" - usage - exit 1 - ;; - esac - shift -done - -if [ -n "$threads" ]; then - thread_args="-j$threads" -fi - -set -xe - -cd $(mktemp -d -p /var/tmp) -git clone $repo_url -cd llvm-toolchain-integration-test-suite -mkdir _build && cd _build -cmake .. -GNinja -ninja $thread_args check diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 654240d..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,25 +0,0 @@ -- hosts: localhost - roles: - - role: standard-test-basic - tags: - - classic - required_packages: - # the requirements below are for the integration suite - - cmake - - llvm-devel - - clang - - clang-analyzer - - clang-tools-extra - - compiler-rt - - ninja-build - - libcxx-devel - - libomp-devel - - python-lit - - lld - - lldb - - git - - make - - libstdc++-static - - clang-devel - tests: - - integration-test-suite