From ab620ce7f02f9be2d8a82f48e72fd07970a12e39 Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Thu, 22 Feb 2024 13:11:11 +0100 Subject: [PATCH] Reorganize tests repository. * Created common configuration file (tests/main.fmf) to take advantage of fmf elasticity and inheritance. * Cleanup and simplify all tests metadata. * Remove no longer needed adjustments from plans * Support lld tests in s390x for llvm >= 18 --- build-gating-alternatives.fmf | 20 ++++-------- build-gating.fmf | 20 ++++-------- tests/basic/main.fmf | 16 +--------- tests/gcc-compat-basic/main.fmf | 29 ++---------------- tests/ld-alternative/main.fmf | 31 ++----------------- tests/main.fmf | 54 +++++++++++++++++++++++++++++++++ 6 files changed, 72 insertions(+), 98 deletions(-) create mode 100644 tests/main.fmf diff --git a/build-gating-alternatives.fmf b/build-gating-alternatives.fmf index 0d52a79..785152f 100644 --- a/build-gating-alternatives.fmf +++ b/build-gating-alternatives.fmf @@ -19,22 +19,14 @@ adjust: and trigger != build enabled: false - - because: lld is not shipped for s390x or ppc64 + - because: lld is not shipped for ppc64 enabled: false - when: arch == s390x or arch == ppc64 + when: arch == ppc64 - - 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" - - because: "When testing SCL-ized LLVM, the collection must be enabled first" - environment+: - WITH_SCL: "scl enable llvm-toolset-15.0" - when: "collection == llvm-toolset-15.0" + - because: lld is not shipped in s390x on LLVM < 18 + enabled: false + when: > + arch == s390x and distro < rhel-9, rhel-9.5, fedora-40, centos-stream-9 discover: - name: lld-tests diff --git a/build-gating.fmf b/build-gating.fmf index e67f5a8..6be9987 100644 --- a/build-gating.fmf +++ b/build-gating.fmf @@ -19,22 +19,14 @@ adjust: and trigger != build enabled: false - - because: lld is not shipped for s390x and ppc64 + - because: lld is not shipped for ppc64 enabled: false - when: arch == s390x or arch == ppc64 + when: arch == ppc64 - - 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" - - because: "When testing SCL-ized LLVM, the collection must be enabled first" - environment+: - WITH_SCL: "scl enable llvm-toolset-15.0" - when: "collection == llvm-toolset-15.0" + - because: lld is not shipped in s390x on LLVM < 18 + enabled: false + when: > + arch == s390x and distro < rhel-9, rhel-9.5, fedora-40, centos-stream-9 discover: - name: lld-tests diff --git a/tests/basic/main.fmf b/tests/basic/main.fmf index f4d96e0..65613c8 100644 --- a/tests/basic/main.fmf +++ b/tests/basic/main.fmf @@ -1,36 +1,22 @@ summary: Test lld with clang -test: "$WITH_SCL ./test.sh" -require: [] -framework: shell tier: 1 -component: - - llvm-toolset - - lld extra-summary: /tools/lld/basic extra-task: /tools/lld/basic extra-nitrate: TC#0614058 -adjust: - - because: lld is not shipped for s390x and ppc64 - enabled: false - when: arch == s390x or arch == ppc64 - +adjust+: # Common requirements when LLVM is not SCL-ized - require+: - clang - - lld when: collection is not defined # Requirements for SCL-ized LLVM - require+: - llvm-toolset-13.0-clang - - llvm-toolset-13.0-lld when: collection == llvm-toolset-13.0 - require+: - llvm-toolset-14.0-clang - - llvm-toolset-14.0-lld when: collection == llvm-toolset-14.0 - require+: - llvm-toolset-15.0-clang - - llvm-toolset-15.0-lld when: collection == llvm-toolset-15.0 diff --git a/tests/gcc-compat-basic/main.fmf b/tests/gcc-compat-basic/main.fmf index f2abfd2..97b3f9c 100644 --- a/tests/gcc-compat-basic/main.fmf +++ b/tests/gcc-compat-basic/main.fmf @@ -1,37 +1,12 @@ summary: Test lld with gcc -test: "$WITH_SCL ./test.sh" -require: +require+: - gcc -framework: shell tier: 1 -component: - - llvm-toolset - - lld extra-summary: /tools/lld/gcc-compat-basic extra-task: /tools/lld/gcc-compat-basic extra-nitrate: TC#0614059 -adjust: - - because: lld is not shipped for s390x and ppc64 - enabled: false - when: arch == s390x or arch == ppc64 - +adjust+: - because: system gcc is too old in rhel-7 enabled: false when: distro <= rhel-7 - - # Common requirements when LLVM is not SCL-ized - - require+: - - lld - when: collection is not defined - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-lld - when: collection == llvm-toolset-13.0 - - require+: - - llvm-toolset-14.0-lld - when: collection == llvm-toolset-14.0 - - require+: - - llvm-toolset-15.0-lld - when: collection == llvm-toolset-15.0 diff --git a/tests/ld-alternative/main.fmf b/tests/ld-alternative/main.fmf index 382ed4e..591d028 100644 --- a/tests/ld-alternative/main.fmf +++ b/tests/ld-alternative/main.fmf @@ -1,40 +1,15 @@ summary: Test linker switching with alternatives -test: "$WITH_SCL ./test.sh" # This test spoils the installation by removing lld, therefore it should be marked as such. -tag: +tag+: - spoils-installation -require: +require+: - binutils -framework: shell tier: 1 -component: - - llvm-toolset - - lld extra-summary: /tools/lld/ld-alternative extra-task: /tools/lld/ld-alternative extra-nitrate: TC#0614060 -adjust: - - because: lld is not shipped for s390x and ppc64 - enabled: false - when: arch == s390x or arch == ppc64 - +adjust+: - because: lld is not installed as ld alternative in rhel < 9 enabled: false when: distro < rhel-9 - - # Common requirements when LLVM is not SCL-ized - - require+: - - lld - when: collection is not defined - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-lld - when: collection == llvm-toolset-13.0 - - require+: - - llvm-toolset-14.0-lld - when: collection == llvm-toolset-14.0 - - require+: - - llvm-toolset-15.0-lld - when: collection == llvm-toolset-15.0 diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..47ffb7d --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,54 @@ +# Common configuration for all the tests in this repo +# All the tmt tests under this directory inherit the settings from this file +component: + - llvm-toolset + - lld + +# Default QA contact. If more are relevant use 'contact+:' in each test metadata. +contact: + - Jesus Checa Hidalgo + +# All tests are shell by default. If a specific test uses another framework +# such as beakerlib, define "framework: beakerlib" in the test's main.fmf +framework: shell + +# Always define "test" key and override in adjust or in each specific test +# metadata if needed. +test: ./test.sh + +# Commonly used keys are initialized to empty. +require: [] +link: [] +tag: [] + +adjust+: + - because: lld is not shipped for ppc64 + enabled: false + when: arch == ppc64 + + - because: lld is not shipped in s390x on LLVM < 18 + enabled: false + when: > + arch == s390x and distro < rhel-9, rhel-9.5, fedora-40, centos-stream-9 + + # Common requirements when LLVM is not SCL-ized + - require+: + - lld + when: collection is not defined + + # Requirements for SCL-ized LLVM + # We need to override the test key to do the proper scl call + - test: scl enable llvm-toolset-13.0 -- ./test.sh + require+: + - llvm-toolset-13.0-lld + when: collection == llvm-toolset-13.0 + + - test: scl enable llvm-toolset-14.0 -- ./test.sh + require+: + - llvm-toolset-14.0-lld + when: collection == llvm-toolset-14.0 + + - test: scl enable llvm-toolset-15.0 -- ./test.sh + require+: + - llvm-toolset-15.0-lld + when: collection == llvm-toolset-15.0 \ No newline at end of file