From: Eduard Bagdasaryan Date: Sun, 16 Mar 2025 22:03:22 +0000 (+0000) Subject: CI: Enable eCAP and Valgrind in layer build tests if possible (#1996) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a13e36b98d3c68b13d4ab20e3b25ee5dd3aef4b;p=thirdparty%2Fsquid.git CI: Enable eCAP and Valgrind in layer build tests if possible (#1996) Now these optional features are enabled during applicable layer tests if their packages appear to be available on the build system. This should help prevent regressions like the one fixed in recent commit 53ed1a9. --- diff --git a/.github/workflows/quick.yaml b/.github/workflows/quick.yaml index 2383244752..6023041516 100644 --- a/.github/workflows/quick.yaml +++ b/.github/workflows/quick.yaml @@ -136,7 +136,7 @@ jobs: sudo sed --in-place -E 's/# (deb-src.*updates main)/ \1/g' /etc/apt/sources.list sudo apt-get --quiet=2 update sudo apt-get --quiet=2 build-dep squid - sudo apt-get --quiet=2 install linuxdoc-tools libtool-bin ${{ matrix.compiler.CC }} ccache + sudo apt-get --quiet=2 install linuxdoc-tools libtool-bin ${{ matrix.compiler.CC }} ccache valgrind - name: Checkout sources uses: actions/checkout@v4 diff --git a/test-suite/buildtest.sh b/test-suite/buildtest.sh index 0c3ab21b56..41a51741ea 100755 --- a/test-suite/buildtest.sh +++ b/test-suite/buildtest.sh @@ -16,6 +16,22 @@ action="${1}" config="${2}" +# Allow a layer to enable optional default-disabled features when +# those features are supported in the current build environment +# (and we can easily detect such support). +if ${PKG_CONFIG:-pkg-config} --exists 'libecap >= 1.0 libecap < 1.1' 2>/dev/null +then + CONFIGURE_FLAGS_MAYBE_ENABLE_ECAP="--enable-ecap" +else + echo "WARNING: eCAP testing disabled" >&2 +fi +if ${PKG_CONFIG:-pkg-config} --exists valgrind 2>/dev/null +then + CONFIGURE_FLAGS_MAYBE_ENABLE_VALGRIND="--with-valgrind-debug" +else + echo "WARNING: Valgrind testing disabled" >&2 +fi + # cache_file may be set by environment variable configcache="" if [ -n "$cache_file" ]; then diff --git a/test-suite/buildtests/layer-02-maximus.opts b/test-suite/buildtests/layer-02-maximus.opts index ce03ab5350..b8fc383b63 100644 --- a/test-suite/buildtests/layer-02-maximus.opts +++ b/test-suite/buildtests/layer-02-maximus.opts @@ -37,11 +37,9 @@ MAKETEST="distcheck" # We can't test them automatically everywhere without detecting those # optional packages first. # -# --enable-ecap \ # --enable-epoll \ # --enable-kqueue \ # --enable-win32-service \ -# --with-valgrind-debug \ # --with-gnutls \ # --with-tdb \ # --with-cap \ @@ -110,6 +108,8 @@ DISTCHECK_CONFIGURE_FLAGS=" \ --enable-build-info=squid\ test\ build \ --enable-ssl-crtd \ --with-openssl \ + $CONFIGURE_FLAGS_MAYBE_ENABLE_ECAP \ + $CONFIGURE_FLAGS_MAYBE_ENABLE_VALGRIND \ " # Fix the distclean testing. diff --git a/test-suite/buildtests/layer-04-noauth-everything.opts b/test-suite/buildtests/layer-04-noauth-everything.opts index f89911b386..4f9ecc77e7 100644 --- a/test-suite/buildtests/layer-04-noauth-everything.opts +++ b/test-suite/buildtests/layer-04-noauth-everything.opts @@ -42,11 +42,9 @@ MAKETEST="distcheck" # We can't test them automatically everywhere without detecting those # optional packages first. # -# --enable-ecap \ # --enable-epoll \ # --enable-kqueue \ # --enable-win32-service \ -# --with-valgrind-debug \ # --with-ldap \ # # --enable-cpu-profiling \ Requires CPU support. @@ -110,6 +108,8 @@ DISTCHECK_CONFIGURE_FLAGS=" \ --with-pic \ --with-pthreads \ --enable-build-info=squid\ test\ build \ + $CONFIGURE_FLAGS_MAYBE_ENABLE_ECAP \ + $CONFIGURE_FLAGS_MAYBE_ENABLE_VALGRIND \ " # Fix the distclean testing.