]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
ci: reintroduce Go tests into the CI
authorOto Šťáva <oto.stava@nic.cz>
Tue, 6 Jun 2023 12:50:20 +0000 (14:50 +0200)
committerOto Šťáva <oto.stava@nic.cz>
Wed, 7 Jun 2023 06:09:40 +0000 (08:09 +0200)
.gitlab-ci.yml
ci/images/build.sh
ci/images/debian-11/Dockerfile
ci/images/debian-buster/Dockerfile

index 4d50a5eb1fcf3dfd88c31a68c243e23528e624e6..641de80a7a60782e51a8e9e925de7aa140617132 100644 (file)
@@ -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
index 39ee61711ad16c58ebad694ef02150a0b14470c3..1e9eabb5b1a27d7007e33b1caeff9498547f76e7 100755 (executable)
@@ -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
index 59f170bac221ee7e00441d74585c85d6b7216fdc..9645cddb5a5a300577a40435ccf3bb31ae81ff40 100644 (file)
@@ -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
index 4b47dda1961a380e91bf095c9feb72bb1f85d206..39f432774d97d84615dbca2bd89c9fe506d71882 100644 (file)
@@ -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