summaryrefslogtreecommitdiffstats
path: root/tests/deckard/.gitlab-ci.yml
blob: b1ec808a9d3ad75d828148fe13a98449ede9198a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
image: $CI_REGISTRY/knot/knot-resolver/ci/debian-stable:knot-2.7
variables:
  LC_ALL: C.UTF-8

stages:
  - test

.test: &test
  stage: test
  tags:
    - docker
    - linux
    - amd64

test:augeas:
  <<: *test
  script:
    - augparse pydnstest/deckard.aug

test:flake8:
  <<: *test
  script:
    - python3 -m flake8 --max-line-length=100 . && echo "OK, no flake8 errors detected"

test:mypy:
  <<: *test
  script:
    - ci/mypy-run.sh  && echo "OK, no mypy error detected"

test:pylint:
  <<: *test
  script:
    - ci/pylint-run.sh

test:rplint:
  <<: *test
  script:
    - cp ci/common.sh /tmp
    - cp ci/compare-rplint.sh /tmp
    - /tmp/compare-rplint.sh

test:unittests:
  <<: *test
  script:
    - make check

# changes in Deckard itself must not change result of tests
test:comparative:kresd:
  <<: *test
  script:
    # test kresd binary
    - git clone --depth=1 https://gitlab.labs.nic.cz/knot/knot-resolver.git /tmp/kresd-local-build
    - GIT_DIR=/tmp/kresd-local-build/.git git log -1
    - ( cd /tmp/kresd-local-build ; git submodule update --init --recursive )
    - PREFIX=/tmp/.local make -C /tmp/kresd-local-build -k all
    - PREFIX=/tmp/.local make -C /tmp/kresd-local-build install
    # compare results from latest Deckard with results from merge base
    - cp ci/common.sh /tmp
    - cp ci/compare-tests.sh /tmp
    - cp ci/junit-compare.py /tmp
    - LD_LIBRARY_PATH=/tmp/.local/lib PATH=/tmp/.local/sbin:$PATH /tmp/compare-tests.sh $(pwd)/kresd_run.sh
  artifacts:
    when: always
    expire_in: '1 hour'
    paths:
      - modified_tests
      - base.xml
      - head.xml

# Run all tests on the latest kresd version to ensure that we not push tests
# which do not work on latest kresd. It would lead to breakage in kresd CI.
test:latest:kresd:
  <<: *test
  script:
    - git clone --depth=1 https://gitlab.labs.nic.cz/knot/knot-resolver.git kresd-local-build
    - GIT_DIR=$(pwd)/kresd-local-build/.git git log -1
    - ( cd kresd-local-build ; git submodule update --init --recursive )
    - PREFIX=$(pwd)/.local make -C kresd-local-build -k all
    - PREFIX=$(pwd)/.local make -C kresd-local-build install
    - TMPDIR=$(pwd) LD_LIBRARY_PATH=$(pwd)/.local/lib PATH=$(pwd)/.local/sbin:$PATH ./kresd_run.sh -n $(nproc)
  artifacts:
    when: on_failure
    expire_in: 1 week
    paths:
      - tmpdeckard*

# sanity check that Unbound under Deckard still works
# I've selected the only tests which are working
# on kresd and Unbound 1.5.8 as well as 1.6.0
test:sanity:unbound:
  <<: *test
  script:
    - TMPDIR=$(pwd) ./unbound_run.sh -k sets/resolver/iter_hint_lame.rpl
    - TMPDIR=$(pwd) ./unbound_run.sh -k sets/resolver/iter_lame_root.rpl
    # these do not work with Unbound 1.5.8 which is in CI container
      #- TESTS=sets/resolver/nsec_wildcard_answer_response.rpl ./unbound_run.sh
      #- TESTS=sets/resolver/world_cz_lidovky_www.rpl ./unbound_run.sh
  artifacts:
    when: on_failure
    expire_in: 1 week
    paths:
      - tmpdeckard*

# sanity check that PowerDNS recursor under Deckard still works
# I've selected couple tests which are working
# on kresd and PowerDNS recursor 4.0.0~alpha2 as well as 4.0.4
test:sanity:pdnsrecursor:
  <<: *test
  script:
    - TMPDIR=$(pwd) ./pdns_run.sh -k sets/resolver/iter_recurse.rpl
    - TMPDIR=$(pwd) ./pdns_run.sh -k sets/resolver/iter_tcbit.rpl
  artifacts:
    when: on_failure
    expire_in: 1 week
    paths:
      - tmpdeckard*