]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests: integrate new Deckard test interface
authorPetr Špaček <petr.spacek@nic.cz>
Fri, 6 Apr 2018 07:18:13 +0000 (09:18 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Fri, 22 Jun 2018 12:14:09 +0000 (14:14 +0200)
.gitlab-ci.yml
tests/deckard
tests/test_integration.mk

index d4e60eb903c071c6b3998ff98d8fc31ff4beb00e..66c4adae13a6a1c24343c875fedb120e7caaec69 100644 (file)
@@ -128,14 +128,12 @@ doc:
   tags:
     - docker
 
-
-
 deckard:linux:amd64:
   stage: test
   except:
     - schedules  # prevent unstable test from cancelling nightly OBS build
   script:
-    - PREFIX=$(pwd)/.local MAKEFLAGS="--jobs $(nproc) --keep-going" make check-integration
+    - PREFIX=$(pwd)/.local MAKEFLAGS="--jobs $(nproc)" DECKARDFLAGS="-n $(nproc)" make check-integration
     - PREFIX=$(pwd)/.local MAKEFLAGS="--jobs $(nproc)" make coverage-c coverage-lua COVERAGE_STAGE=gcov-deckard
   dependencies:
     - build:linux:amd64
index ca6336af648f52b71a0d13f17bba3d41728569cb..0164c2a37c384fabba57098d4b30e6381c36e581 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ca6336af648f52b71a0d13f17bba3d41728569cb
+Subproject commit 0164c2a37c384fabba57098d4b30e6381c36e581
index 4d0303b040f5bdf23a259076584ea036a694617a..3046485ae6c9ff61b27a1b487dd39dd4f215e6af 100644 (file)
@@ -2,40 +2,33 @@
 # Integration tests
 #
 # 1. Run tests from main Deckard repo (generic DNS tests)
-# 2. Run Deckard tests from kresd repo (kresd-specific tests)
+
+SUBMODULES_DIRTY := $(shell git submodule status --recursive | cut -c 1 | grep -q '[^ ]' && echo $$?)
+REAL_PREFIX=$(realpath $(PREFIX))
+REAL_CURDIR=$(realpath $(CURDIR))
 
 # Platform-specific library injection
 ifeq ($(PLATFORM),Darwin)
-       preload_syms := DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_LIBRARY_PATH="$(abspath lib):$(DYLD_LIBRARY_PATH)"
+       preload_syms := DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_LIBRARY_PATH="$(abspath $(LIBDIR)):$(DYLD_LIBRARY_PATH)"
 else
-       preload_syms := LD_LIBRARY_PATH="$(abspath lib):$(LD_LIBRARY_PATH)"
+       preload_syms := LD_LIBRARY_PATH="$(abspath $(LIBDIR)):$(LD_LIBRARY_PATH)"
 endif
 
-tests_integr := \
-       $(wildcard modules/*/*.test.integr) \
-       $(wildcard modules/*/*/*.test.integr)
-
 # Integration tests from Deckard repo
 deckard_DIR := tests/deckard
-TESTS := sets/resolver
-TEMPLATE := template/kresd.j2
-SUBMODULES_DIRTY := $(shell git submodule status --recursive | cut -c 1 | grep -q '[^ ]' && echo $$?)
-
-REAL_PREFIX=$(realpath $(PREFIX))
-REAL_CURDIR=$(realpath $(CURDIR))
 
 $(deckard_DIR)/Makefile:
        @git submodule update --init --recursive
 
 check-install-precond:
+       $(if $(SUBMODULES_DIRTY), $(warning Warning: Git submodules are not up-to-date, expect test failures),)
        $(if $(findstring $(REAL_CURDIR),$(REAL_PREFIX)),, $(warning Warning: PREFIX does not point into source directory; testing version in $(PREFIX)!))
+       @test -x "$(SBINDIR)/kresd" || (echo 'to run integration tests install kresd into into $$PREFIX ($(SBINDIR)/kresd)' && exit 1)
 
 # Deckard requires additional depedencies so it is not part of installcheck
 deckard: check-install-precond $(deckard_DIR)/Makefile
-       $(if $(SUBMODULES_DIRTY), $(warning Warning: Git submodules are not up-to-date),)
-       @mkdir -p $(deckard_DIR)/contrib/libswrap/obj
-       +TESTS=$(TESTS) DAEMON=$(abspath $(SBINDIR)/kresd) TEMPLATE=$(TEMPLATE) COVERAGE_ENV_SCRIPT=$(TOPSRCDIR)/scripts/coverage_env.sh DAEMONSRCDIR=$(TOPSRCDIR) COVERAGE_STATSDIR=$(COVERAGE_STATSDIR)/deckard $(preload_syms) $(deckard_DIR)/kresd_run.sh
+       COVERAGE_ENV_SCRIPT="$(TOPSRCDIR)/scripts/coverage_env.sh" DAEMONSRCDIR="$(TOPSRCDIR)" COVERAGE_STATSDIR="$(COVERAGE_STATSDIR)/deckard" $(preload_syms) PATH="$(SBINDIR):$$PATH" "$(deckard_DIR)/kresd_run.sh"
 
 check-integration: deckard
 
-.PHONY: deckard check-integration
+.PHONY: check-install-precond deckard check-integration