From afed217ebc522e339e6197b9910c10c4787db7cb Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 19 Aug 2020 14:39:12 +0000 Subject: [PATCH] Fix regression-tests CI tests --- llvm.spec | 16 ++++++++++++---- run-lit-tests | 1 + tests/regression-tests/runtest.sh | 16 ++++++++++++++++ tests/tests.yml | 4 +--- 4 files changed, 30 insertions(+), 7 deletions(-) create mode 100755 tests/regression-tests/runtest.sh diff --git a/llvm.spec b/llvm.spec index ff2ec91..baab061 100644 --- a/llvm.spec +++ b/llvm.spec @@ -11,7 +11,7 @@ %global llvm_libdir %{_libdir}/%{name} %global build_llvm_libdir %{buildroot}%{llvm_libdir} %global rc_ver 1 -%global baserelease 0.3 +%global baserelease 0.4 %global llvm_srcdir llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src %global maj_ver 11 %global min_ver 0 @@ -322,10 +322,14 @@ cp -R utils/unittest %{install_srcdir}/utils/ cp utils/update_cc_test_checks.py %{install_srcdir}/utils/ cp -R utils/UpdateTestChecks %{install_srcdir}/utils/ -# Generate lit config files. Strip off the last line that initiates the +# One of the lit tests references this file +install -d %{install_srcdir}/docs/CommandGuide/ +install -m 0644 docs/CommandGuide/dsymutil.rst %{install_srcdir}/docs/CommandGuide/ + +# Generate lit config files. Strip off the last lines that initiates the # test run, so we can customize the configuration. -head -n -1 %{_vpath_builddir}/test/lit.site.cfg.py >> %{lit_cfg} -head -n -1 %{_vpath_builddir}/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg} +head -n -2 %{_vpath_builddir}/test/lit.site.cfg.py >> %{lit_cfg} +head -n -2 %{_vpath_builddir}/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg} # Install custom fedora config file cp %{SOURCE2} %{buildroot}%{lit_fedora_cfg} @@ -518,6 +522,7 @@ fi %{_datadir}/llvm/src/%{_arch}.site.cfg.py %{_datadir}/llvm/src/%{_arch}.Unit.site.cfg.py %{_datadir}/llvm/lit.fedora.cfg.py +%{_datadir}/llvm/src/docs/CommandGuide/dsymutil.rst %{_bindir}/not %{_bindir}/count %{_bindir}/yaml-bench @@ -535,6 +540,9 @@ fi %endif %changelog +* Wed Aug 19 2020 Tom Stellard - 11.0.0-0.4.rc1 +- Fix regression-tests CI tests + * Tue Aug 18 2020 Tom Stellard - 11.0.0-0.3.rc1 - Fix rust crash on ppc64le compiling firefox - rhbz#1862012 diff --git a/run-lit-tests b/run-lit-tests index 11fc0f4..314f2be 100755 --- a/run-lit-tests +++ b/run-lit-tests @@ -48,6 +48,7 @@ esac cd $(mktemp -d) ln -s /usr/include include +ln -s /usr/share/llvm/src/docs docs tar -xzf /usr/share/llvm/src/test.tar.gz ln -s /usr/share/llvm/src/$ARCH.site.cfg.py test/lit.site.cfg.py ln -s /usr/share/llvm/src/$ARCH.Unit.site.cfg.py test/Unit/lit.site.cfg.py diff --git a/tests/regression-tests/runtest.sh b/tests/regression-tests/runtest.sh new file mode 100755 index 0000000..42aa9b5 --- /dev/null +++ b/tests/regression-tests/runtest.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -ex + +cmd='/usr/libexec/tests/llvm/run-lit-tests --threads 1' +if [ `id -u` -eq 0 ]; then + # lit tests can't be run as root, so we need to run as a different user + user='llvm-regression-tests' + if ! id -u $user; then + useradd $user + fi + su $user -c "$cmd" + cmd="su $user -c $cmd" +else + exec $cmd +fi diff --git a/tests/tests.yml b/tests/tests.yml index 78913b9..b5f59e9 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -13,9 +13,7 @@ - repo: "https://src.fedoraproject.org/tests/llvm.git" dest: "llvm" tests: - - regression-tests: - dir: ./ - run: /usr/libexec/tests/llvm/run-lit-tests --threads 1 + - regression-tests - rust-sanity: dir: ./ run: cargo new hello && cd hello && cargo run