From: Oto Šťáva Date: Tue, 6 Jun 2023 12:50:20 +0000 (+0200) Subject: ci: reintroduce Go tests into the CI X-Git-Tag: v5.7.0~6^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40e89386c25dd5ad47bb3c0b6d28be5870e6351b;p=thirdparty%2Fknot-resolver.git ci: reintroduce Go tests into the CI --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d50a5eb1..641de80a7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -109,7 +109,7 @@ build: - meson build_ci --default-library=static --prefix=$PREFIX -Dmalloc=disabled -Dwerror=true -Dextra_tests=enabled - ninja -C build_ci - ninja -C build_ci install >/dev/null - - ${MESON_TEST} --suite unit --suite config --no-suite snowflake + - ${MESON_TEST} --suite unit --suite config --suite dnstap --no-suite snowflake build-knot32: <<: *build @@ -118,7 +118,7 @@ build-knot32: - meson build_ci_knot32 --default-library=static --prefix=$PREFIX -Dmalloc=disabled -Dwerror=true -Dextra_tests=enabled - ninja -C build_ci_knot32 - ninja -C build_ci_knot32 install >/dev/null - - ${MESON_TEST} --suite unit --suite config --no-suite snowflake + - ${MESON_TEST} --suite unit --suite config --suite dnstap --no-suite snowflake build-asan: <<: *build @@ -129,7 +129,7 @@ build-asan: - ninja -C build_ci_asan install >/dev/null # TODO _leaks: not sure what exactly is wrong in leak detection on config tests # TODO skip_asan: all three of these disappear locally when using gcc 9.1 (except some leaks) - - MESON_TESTTHREADS=1 ASAN_OPTIONS=detect_leaks=0 ${MESON_TEST} --suite unit --suite config --no-suite skip_asan --no-suite snowflake + - MESON_TESTTHREADS=1 ASAN_OPTIONS=detect_leaks=0 ${MESON_TEST} --suite unit --suite config --suite dnstap --no-suite skip_asan --no-suite snowflake build:macOS: <<: *nodep diff --git a/ci/images/build.sh b/ci/images/build.sh index 39ee61711..1e9eabb5b 100755 --- a/ci/images/build.sh +++ b/ci/images/build.sh @@ -9,5 +9,15 @@ if [ -n "$COVERITY_SCAN_TOKEN" ]; then SECRETS="$SECRETS --secret id=coverity-token,env=COVERITY_SCAN_TOKEN" fi +DOCKERFILE="$(realpath "${IMAGE}")/Dockerfile" + +cd "$CURRENT_DIR/../.." export DOCKER_BUILDKIT=1 # Enables using secrets in docker-build -docker build --pull --no-cache -t "${FULL_NAME}" "${IMAGE}" --build-arg KNOT_BRANCH=${KNOT_BRANCH} $SECRETS +docker build \ + --pull \ + --no-cache \ + --tag "${FULL_NAME}" \ + --file "${DOCKERFILE}" \ + . \ + --build-arg KNOT_BRANCH=${KNOT_BRANCH} \ + $SECRETS diff --git a/ci/images/debian-11/Dockerfile b/ci/images/debian-11/Dockerfile index 59f170bac..9645cddb5 100644 --- a/ci/images/debian-11/Dockerfile +++ b/ci/images/debian-11/Dockerfile @@ -21,10 +21,12 @@ RUN apt-get install -y -qqq git make cmake pkg-config meson \ # Build and testing deps for Resolver's dnstap module (go stuff is just for testing) RUN apt-get install -y -qqq \ - protobuf-c-compiler libprotobuf-c-dev libfstrm-dev -# Maintaining the go stuff in CI really seems more trouble than worth. -# golang-any -#RUN bash -c "go get github.com/{FiloSottile/gvt,cloudflare/dns,dnstap/golang-dnstap,golang/protobuf/proto}" + protobuf-c-compiler libprotobuf-c-dev libfstrm-dev \ + golang-any +COPY ./tests/dnstap /root/tests/dnstap +WORKDIR /root/tests/dnstap/src/dnstap-test +RUN go get . +WORKDIR /root # documentation dependencies RUN apt-get install -y -qqq doxygen python3-sphinx python3-breathe python3-sphinx-rtd-theme diff --git a/ci/images/debian-buster/Dockerfile b/ci/images/debian-buster/Dockerfile index 4b47dda19..39f432774 100644 --- a/ci/images/debian-buster/Dockerfile +++ b/ci/images/debian-buster/Dockerfile @@ -25,9 +25,10 @@ RUN apt-get install -y -qqq git make cmake pkg-config meson \ RUN apt-get install -y -qqq \ protobuf-c-compiler libprotobuf-c-dev libfstrm-dev \ golang-any -# Some stuff won't work on buster: -# package crypto/ed25519: unrecognized import path "crypto/ed25519" -#RUN bash -c "go get github.com/{FiloSottile/gvt,cloudflare/dns,dnstap/golang-dnstap}" +COPY ./tests/dnstap /root/tests/dnstap +WORKDIR /root/tests/dnstap/src/dnstap-test +RUN go get . +WORKDIR /root # documentation dependencies RUN apt-get install -y -qqq doxygen python3-sphinx python3-breathe python3-sphinx-rtd-theme @@ -41,7 +42,7 @@ RUN pip3 install pylint RUN pip3 install pep8 RUN pip3 install pytest-xdist # tests/pytest dependencies: skip over broken versions -RUN pip3 install 'dnspython != 2.0.0' jinja2 'pytest != 6.0.0' pytest-html pytest-xdist +RUN pip3 install 'dnspython != 2.0.0' 'jinja2 == 2.11.3' 'pytest != 6.0.0' pytest-html pytest-xdist # packet capture tools for Deckard RUN apt-get install --no-install-suggests --no-install-recommends -y -qqq tcpdump wireshark-common