From 2ce66b7035cb87ed3521f819ad296ff729d6bee9 Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Mon, 12 Sep 2022 13:18:15 +0200 Subject: [PATCH] Migrate tests to tests/llvm repo --- tests/README.md | 6 ++ tests/binutils-plugin-ar/main.fmf | 2 - tests/binutils-plugin-ar/test.sh | 7 --- tests/build-compat/main.fmf | 3 - tests/build-compat/test.sh | 14 ----- tests/build-gating.fmf | 3 + tests/integration-test-suite/main.fmf | 81 --------------------------- tests/integration-test-suite/test.sh | 39 ------------- tests/libllvm-size/main.fmf | 13 ----- tests/libllvm-size/test.sh | 10 ---- tests/llvm-config/main.fmf | 2 - tests/llvm-config/test.sh | 3 - tests/rust-sanity/main.fmf | 30 ---------- tests/rust-sanity/test.sh | 5 -- tests/versioned-llvm-config/main.fmf | 2 - tests/versioned-llvm-config/test.sh | 5 -- 16 files changed, 9 insertions(+), 216 deletions(-) create mode 100644 tests/README.md delete mode 100644 tests/binutils-plugin-ar/main.fmf delete mode 100755 tests/binutils-plugin-ar/test.sh delete mode 100644 tests/build-compat/main.fmf delete mode 100755 tests/build-compat/test.sh delete mode 100644 tests/integration-test-suite/main.fmf delete mode 100755 tests/integration-test-suite/test.sh delete mode 100644 tests/libllvm-size/main.fmf delete mode 100755 tests/libllvm-size/test.sh delete mode 100644 tests/llvm-config/main.fmf delete mode 100755 tests/llvm-config/test.sh delete mode 100644 tests/rust-sanity/main.fmf delete mode 100755 tests/rust-sanity/test.sh delete mode 100644 tests/versioned-llvm-config/main.fmf delete mode 100755 tests/versioned-llvm-config/test.sh diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..5aeb3d6 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,6 @@ +# Gating testplans for LLVM + +The tests for LLVM are in a separate repo: https://src.fedoraproject.org/tests/llvm +This directory should contain only fmf plans (such as build-gating.fmf) which import +the tests from the tests repo. This can be done using the "url" parameter of the +plan's "discover" step. Reference: https://tmt.readthedocs.io/en/stable/spec/plans.html#fmf \ No newline at end of file diff --git a/tests/binutils-plugin-ar/main.fmf b/tests/binutils-plugin-ar/main.fmf deleted file mode 100644 index 675bc21..0000000 --- a/tests/binutils-plugin-ar/main.fmf +++ /dev/null @@ -1,2 +0,0 @@ -summary: Make sure the the LLVM plugin for binutils' ar works -test: "$WITH_SCL ./test.sh" diff --git a/tests/binutils-plugin-ar/test.sh b/tests/binutils-plugin-ar/test.sh deleted file mode 100755 index 5dbacec..0000000 --- a/tests/binutils-plugin-ar/test.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -eux - -set pipefail - -echo "void lto_function(){}" | clang -flto -O2 -c -x c -o foo.o - -ar crs foo.a foo.o -readelf -c foo.a | grep lto_function diff --git a/tests/build-compat/main.fmf b/tests/build-compat/main.fmf deleted file mode 100644 index 7e0a3d3..0000000 --- a/tests/build-compat/main.fmf +++ /dev/null @@ -1,3 +0,0 @@ -summary: Make sure rebuilding LLVM still works with the new LLVM -test: "$WITH_SCL ./test.sh" -enabled: false diff --git a/tests/build-compat/test.sh b/tests/build-compat/test.sh deleted file mode 100755 index 04a97b2..0000000 --- a/tests/build-compat/test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -eux - -dnf download --disablerepo=* --enablerepo=test-llvm --source llvm - -# The src.rpm is available in the directory the test run from. -set +e -mock --resultdir=. --old-chroot --with compat_build --rebuild *.src.rpm -if [ $? -ne 0 ]; then - cat root.log - cat build.log - exit 1 -fi - -exit 0 diff --git a/tests/build-gating.fmf b/tests/build-gating.fmf index d7549b2..8c19a1a 100644 --- a/tests/build-gating.fmf +++ b/tests/build-gating.fmf @@ -48,7 +48,10 @@ adjust: or distro == rhel-8 discover: + - name: llvm-tests how: fmf + url: https://src.fedoraproject.org/tests/llvm.git + ref: main execute: how: tmt provision: diff --git a/tests/integration-test-suite/main.fmf b/tests/integration-test-suite/main.fmf deleted file mode 100644 index 60504b4..0000000 --- a/tests/integration-test-suite/main.fmf +++ /dev/null @@ -1,81 +0,0 @@ -summary: Run the upstream LLVM integration test suite -description: | - Run the upstream LLVM integration test suite -test: "$WITH_SCL ./test.sh" -require: - - git - - make - # These require special repositories to be enabled on RHEL - - libstdc++-static -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" - - require+: - - llvm-toolset-14.0-cmake - - llvm-toolset-14.0-clang - - llvm-toolset-14.0-clang-analyzer - - llvm-toolset-14.0-clang-devel - - llvm-toolset-14.0-clang-tools-extra - - llvm-toolset-14.0-compiler-rt - - llvm-toolset-14.0-lld - - llvm-toolset-14.0-lldb - - llvm-toolset-14.0-libomp-devel - - llvm-toolset-14.0-llvm-devel - - llvm-toolset-14.0-python3-lit - when: "collection == llvm-toolset-14.0" - - # lld not supported in s390x or ppc64. If any lld package was added to - # requirements, remove it. - - require-: - - lld - - llvm-toolset-13.0-lld - - llvm-toolset-14.0-lld - when: arch == s390x or arch == ppc64 - - # libomp not supported in s390x. If any libomp-devel package was added to - # requirements, remove it. - - require-: - - libomp-devel - - llvm-toolset-13.0-libomp-devel - - llvm-toolset-14.0-libomp-devel - when: arch == s390x - - # 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 == centos - or distro == rhel - because: libcxx is not shipped with neither Centos nor RHEL diff --git a/tests/integration-test-suite/test.sh b/tests/integration-test-suite/test.sh deleted file mode 100755 index e350c57..0000000 --- a/tests/integration-test-suite/test.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -eux - -usage() { - echo "usage `basename $0` [OPTIONS]" - echo " --threads NUM The number of threads to use for running tests." -} - -threads=0 -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 [ "$threads" -ge 1 ]; then - thread_args="-j$threads" -fi - -cd $(mktemp -d -p /var/tmp) -git clone $repo_url -cd llvm-toolchain-integration-test-suite -mkdir _build && cd _build -cmake .. ${CMAKE_CXXLIB:-} -# Do not run with make as it will return 2 in case of failures, which will be -# reported by tmt as error instead failure. Run with lit so it returns 1. -lit --show-unsupported --show-xfail -v tests diff --git a/tests/libllvm-size/main.fmf b/tests/libllvm-size/main.fmf deleted file mode 100644 index 2c207dd..0000000 --- a/tests/libllvm-size/main.fmf +++ /dev/null @@ -1,13 +0,0 @@ -summary: Check that libLLVM.so has been properly stripped -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" - - because: "With SCL-ized LLVM, library path is different" - environment+: - LIBLLVM_PATH: /opt/rh/llvm-toolset-14.0/root/usr/lib64/libLLVM.so - when: "collection == llvm-toolset-14.0" \ No newline at end of file diff --git a/tests/libllvm-size/test.sh b/tests/libllvm-size/test.sh deleted file mode 100755 index a9a2dfe..0000000 --- a/tests/libllvm-size/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -eux - -# There is a bug in the build process when it runs out of disk space -# while stripping binaries, which causes the strip to fail, but does -# not fail the build. This results in a libLLVM.so that is over 2GB -# which breaks the nightly compose. So this test checks that libLLVM.so -# is less than 150MB to ensure it was successfully stripped. -# https://bugzilla.redhat.com/show_bug.cgi?id=1793250 - -test $(stat -L -c %s $LIBLLVM_PATH) -lt 157286400 diff --git a/tests/llvm-config/main.fmf b/tests/llvm-config/main.fmf deleted file mode 100644 index f744956..0000000 --- a/tests/llvm-config/main.fmf +++ /dev/null @@ -1,2 +0,0 @@ -summary: Make sure llvm-config symlink is properly set up -test: "$WITH_SCL ./test.sh" diff --git a/tests/llvm-config/test.sh b/tests/llvm-config/test.sh deleted file mode 100755 index 09a0286..0000000 --- a/tests/llvm-config/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -eux - -llvm-config --version diff --git a/tests/rust-sanity/main.fmf b/tests/rust-sanity/main.fmf deleted file mode 100644 index d7b316e..0000000 --- a/tests/rust-sanity/main.fmf +++ /dev/null @@ -1,30 +0,0 @@ -summary: Test basic cargo usage -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 - 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" - - require+: - - rust-toolset-1.62-cargo - - rust-toolset-1.62-rust - when: "collection == llvm-toolset-14.0" \ No newline at end of file diff --git a/tests/rust-sanity/test.sh b/tests/rust-sanity/test.sh deleted file mode 100755 index fa15399..0000000 --- a/tests/rust-sanity/test.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -eux - -cargo new hello -cd hello -cargo run diff --git a/tests/versioned-llvm-config/main.fmf b/tests/versioned-llvm-config/main.fmf deleted file mode 100644 index 212020e..0000000 --- a/tests/versioned-llvm-config/main.fmf +++ /dev/null @@ -1,2 +0,0 @@ -summary: Make sure the versioned llvm-config symlink is properly set up -test: "$WITH_SCL ./test.sh" diff --git a/tests/versioned-llvm-config/test.sh b/tests/versioned-llvm-config/test.sh deleted file mode 100755 index cfe72cf..0000000 --- a/tests/versioned-llvm-config/test.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -eux - -major=$(llvm-config --version | cut -d '.' -f1) - -llvm-config-$major --version