.gitlab-ci.yml 3.35 KB
Newer Older
1
image: $CI_REGISTRY/knot/knot-resolver/ci/debian-stable:knot-2.7
2 3 4 5 6 7
variables:
  LC_ALL: C.UTF-8

stages:
  - test

Tomas Krizek's avatar
Tomas Krizek committed
8
.test: &test
9 10 11 12 13 14
  stage: test
  tags:
    - docker
    - linux
    - amd64

Tomas Krizek's avatar
Tomas Krizek committed
15 16 17 18 19
test:augeas:
  <<: *test
  script:
    - augparse pydnstest/deckard.aug

20
test:flake8:
Tomas Krizek's avatar
Tomas Krizek committed
21
  <<: *test
22
  script:
23
    - python3 -m flake8 --max-line-length=100 . && echo "OK, no flake8 errors detected"
24

Tomas Krizek's avatar
Tomas Krizek committed
25 26 27
test:mypy:
  <<: *test
  script:
28
    - ci/mypy-run.sh  && echo "OK, no mypy error detected"
Tomas Krizek's avatar
Tomas Krizek committed
29

30
test:pylint:
Tomas Krizek's avatar
Tomas Krizek committed
31
  <<: *test
32
  script:
33
    - ci/pylint-run.sh
34

35
test:rplint:
Tomas Krizek's avatar
Tomas Krizek committed
36
  <<: *test
37 38 39 40 41
  script:
    - cp ci/common.sh /tmp
    - cp ci/compare-rplint.sh /tmp
    - /tmp/compare-rplint.sh

42
test:unittests:
Tomas Krizek's avatar
Tomas Krizek committed
43
  <<: *test
44
  script:
45
    - make check
46

47
# changes in Deckard itself must not change result of tests
48
test:comparative:kresd:
Tomas Krizek's avatar
Tomas Krizek committed
49
  <<: *test
50
  script:
51 52 53 54 55 56 57
    # 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
58 59
    - cp ci/common.sh /tmp
    - cp ci/compare-tests.sh /tmp
60
    - cp ci/junit-compare.py /tmp
61
    - LD_LIBRARY_PATH=/tmp/.local/lib PATH=/tmp/.local/sbin:$PATH /tmp/compare-tests.sh $(pwd)/kresd_run.sh
62 63 64 65 66
  artifacts:
    when: always
    expire_in: '1 hour'
    paths:
      - modified_tests
67 68
      - base.xml
      - head.xml
69 70 71

# 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.
72
test:latest:kresd:
Tomas Krizek's avatar
Tomas Krizek committed
73
  <<: *test
74
  script:
75
    - git clone --depth=1 https://gitlab.labs.nic.cz/knot/knot-resolver.git kresd-local-build
76
    - GIT_DIR=$(pwd)/kresd-local-build/.git git log -1
77
    - ( cd kresd-local-build ; git submodule update --init --recursive )
78 79
    - PREFIX=$(pwd)/.local make -C kresd-local-build -k all
    - PREFIX=$(pwd)/.local make -C kresd-local-build install
80
    - TMPDIR=$(pwd) LD_LIBRARY_PATH=$(pwd)/.local/lib PATH=$(pwd)/.local/sbin:$PATH ./kresd_run.sh -n $(nproc)
81 82 83 84 85
  artifacts:
    when: on_failure
    expire_in: 1 week
    paths:
      - tmpdeckard*
86 87 88 89

# 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
90
test:sanity:unbound:
Tomas Krizek's avatar
Tomas Krizek committed
91
  <<: *test
92
  script:
93 94
    - TMPDIR=$(pwd) ./unbound_run.sh -k sets/resolver/iter_hint_lame.rpl
    - TMPDIR=$(pwd) ./unbound_run.sh -k sets/resolver/iter_lame_root.rpl
95 96 97
    # 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
98 99 100 101 102
  artifacts:
    when: on_failure
    expire_in: 1 week
    paths:
      - tmpdeckard*
103 104 105 106

# 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
107
test:sanity:pdnsrecursor:
Tomas Krizek's avatar
Tomas Krizek committed
108
  <<: *test
109
  script:
110 111
    - TMPDIR=$(pwd) ./pdns_run.sh -k sets/resolver/iter_recurse.rpl
    - TMPDIR=$(pwd) ./pdns_run.sh -k sets/resolver/iter_tcbit.rpl
112 113 114 115 116
  artifacts:
    when: on_failure
    expire_in: 1 week
    paths:
      - tmpdeckard*