From 978f4952dd236a53b46380ef2e2796a765187ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Prchl=C3=ADk?= Date: Mon, 6 Dec 2021 09:34:51 +0100 Subject: [PATCH] tests: add support for SCL-ized LLVM 13 (llvm-toolset-13.0) --- tests/binutils-plugin-ar/main.fmf | 2 +- tests/build-compat/main.fmf | 2 +- tests/build-gating.fmf | 22 +++++++++++--- tests/integration-test-suite/main.fmf | 44 +++++++++++++++++++-------- tests/libllvm-size/main.fmf | 9 +++++- tests/libllvm-size/test.sh | 2 +- tests/llvm-config/main.fmf | 2 +- tests/rust-sanity/main.fmf | 38 ++++++++++++++--------- tests/versioned-llvm-config/main.fmf | 2 +- 9 files changed, 87 insertions(+), 36 deletions(-) diff --git a/tests/binutils-plugin-ar/main.fmf b/tests/binutils-plugin-ar/main.fmf index a8b6ebf..675bc21 100644 --- a/tests/binutils-plugin-ar/main.fmf +++ b/tests/binutils-plugin-ar/main.fmf @@ -1,2 +1,2 @@ summary: Make sure the the LLVM plugin for binutils' ar works -test: ./test.sh +test: "$WITH_SCL ./test.sh" diff --git a/tests/build-compat/main.fmf b/tests/build-compat/main.fmf index fe61457..7e0a3d3 100644 --- a/tests/build-compat/main.fmf +++ b/tests/build-compat/main.fmf @@ -1,3 +1,3 @@ summary: Make sure rebuilding LLVM still works with the new LLVM -test: ./test.sh +test: "$WITH_SCL ./test.sh" enabled: false diff --git a/tests/build-gating.fmf b/tests/build-gating.fmf index 962adc4..d9bf11c 100644 --- a/tests/build-gating.fmf +++ b/tests/build-gating.fmf @@ -1,3 +1,15 @@ +# +# Build/PR gating tests for *LLVM 13* +# +# 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: LLVM 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." @@ -6,14 +18,16 @@ adjust: 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 rust-toolset-1.58" + when: "collection == llvm-toolset-13.0" + discover: how: fmf execute: how: tmt -prepare: - - name: packages - how: install - package: llvm provision: hardware: memory: ">= 4 GiB" diff --git a/tests/integration-test-suite/main.fmf b/tests/integration-test-suite/main.fmf index 1bebe3a..035f651 100644 --- a/tests/integration-test-suite/main.fmf +++ b/tests/integration-test-suite/main.fmf @@ -1,29 +1,49 @@ summary: Run the upstream LLVM integration test suite description: | Run the upstream LLVM integration test suite -test: ./test.sh +test: "$WITH_SCL ./test.sh" require: - - cmake - - llvm-devel - - clang - - clang-analyzer - - clang-tools-extra - - compiler-rt - ninja-build - - libomp-devel - - lld - - lldb - git - make - libstdc++-static - - clang-devel - - python3-lit adjust: + # Common requirements when LLVM is not SCL-ized + - require+: + - cmake + - clang + - clang-analyzer + - clang-devel + - clang-tools-extra + - compiler-rt + - lld + - lldb + - libomp-devel + - llvm-devel + - python3-lit + when: "collection is not defined" + + # Requirements for SCL-ized LLVM + - require+: + - llvm-toolset-13.0-cmake + - llvm-toolset-13.0-clang + - llvm-toolset-13.0-clang-analyzer + - llvm-toolset-13.0-clang-devel + - llvm-toolset-13.0-clang-tools-extra + - llvm-toolset-13.0-compiler-rt + - llvm-toolset-13.0-lld + - llvm-toolset-13.0-lldb + - llvm-toolset-13.0-libomp-devel + - llvm-toolset-13.0-llvm-devel + - llvm-toolset-13.0-python3-lit + when: "collection == llvm-toolset-13.0" + # libcxx shall be required in Fedora, it's not shipped with RHEL. - require+: - libcxx-devel when: "distro == fedora" because: testing against libcxx package in Fedora + - environment+: CMAKE_CXXLIB: "-DENABLE_LIBCXX=OFF" when: "distro == rhel" diff --git a/tests/libllvm-size/main.fmf b/tests/libllvm-size/main.fmf index f03b183..cab01ae 100644 --- a/tests/libllvm-size/main.fmf +++ b/tests/libllvm-size/main.fmf @@ -1,2 +1,9 @@ summary: Check that libLLVM.so has been properly stripped -test: ./test.sh +test: "$WITH_SCL ./test.sh" +environment: + LIBLLVM_PATH: /usr/lib64/libLLVM.so +adjust: + - because: "With SCL-ized LLVM, library path is different" + environment+: + LIBLLVM_PATH: /opt/rh/llvm-toolset-13.0/root/usr/lib64/libLLVM.so + when: "collection == llvm-toolset-13.0" diff --git a/tests/libllvm-size/test.sh b/tests/libllvm-size/test.sh index 7ceb8cb..aee5bd7 100755 --- a/tests/libllvm-size/test.sh +++ b/tests/libllvm-size/test.sh @@ -7,4 +7,4 @@ # is less than 100MB to ensure it was successfully stripped. # https://bugzilla.redhat.com/show_bug.cgi?id=1793250 -test $(stat -L -c %s /usr/lib64/libLLVM.so) -lt 104857600 +test $(stat -L -c %s $LIBLLVM_PATH) -lt 104857600 diff --git a/tests/llvm-config/main.fmf b/tests/llvm-config/main.fmf index 6c36dd6..f744956 100644 --- a/tests/llvm-config/main.fmf +++ b/tests/llvm-config/main.fmf @@ -1,2 +1,2 @@ summary: Make sure llvm-config symlink is properly set up -test: ./test.sh +test: "$WITH_SCL ./test.sh" diff --git a/tests/rust-sanity/main.fmf b/tests/rust-sanity/main.fmf index 4f86eba..8a21dbd 100644 --- a/tests/rust-sanity/main.fmf +++ b/tests/rust-sanity/main.fmf @@ -1,16 +1,26 @@ summary: Test basic cargo usage -test: ./test.sh -require: -# Required for rust and possibly other dependant packages -# -# NOTE #1: drop the requirement once the transitional period between releases is gone -# and llvm-compat is no longer a) needed, and b) part of the build. -# -# NOTE #2: keep it the first requirement. Depending on the order of requirements, placing it somewhere -# else in the list may lead to harness uninstalling and re-installing LLVM packages. That a) would be -# a waste of time, b) could potentially hide issues, leading to testing unexpected NVRs. -# -# - llvm-compat +test: "$WITH_SCL ./test.sh" +require: [] +adjust: + # Common requirements when LLVM is not SCL-ized + - require+: + # Required for rust and possibly other dependant packages + # + # NOTE #1: drop the requirement once the transitional period between releases is gone + # and llvm-compat is no longer a) needed, and b) part of the build. + # + # NOTE #2: keep it the first requirement. Depending on the order of requirements, placing it somewhere + # else in the list may lead to harness uninstalling and re-installing LLVM packages. That a) would be + # a waste of time, b) could potentially hide issues, leading to testing unexpected NVRs. + # + # - llvm-compat - - cargo - - rust + - cargo + - rust + when: "collection is not defined" + + # Requirements for SCL-ized LLVM + - require+: + - rust-toolset-1.58-cargo + - rust-toolset-1.58-rust + when: "collection == llvm-toolset-13.0" diff --git a/tests/versioned-llvm-config/main.fmf b/tests/versioned-llvm-config/main.fmf index eddb736..212020e 100644 --- a/tests/versioned-llvm-config/main.fmf +++ b/tests/versioned-llvm-config/main.fmf @@ -1,2 +1,2 @@ summary: Make sure the versioned llvm-config symlink is properly set up -test: ./test.sh +test: "$WITH_SCL ./test.sh"