ci: migrate to meson

parent 681f2954
Pipeline #46442 passed with stage
in 2 minutes and 5 seconds
image: $CI_REGISTRY/knot/knot-resolver/ci/debian-stable:knot-2.7 image: $CI_REGISTRY/knot/knot-resolver/ci/debian-buster:knot-2.8
variables: variables:
LC_ALL: C.UTF-8 LC_ALL: C.UTF-8
...@@ -56,16 +56,17 @@ test:comparative:kresd: ...@@ -56,16 +56,17 @@ test:comparative:kresd:
<<: *test <<: *test
script: script:
# test kresd binary # test kresd binary
- git clone --depth=1 https://gitlab.labs.nic.cz/knot/knot-resolver.git /tmp/kresd-local-build - git clone --recurse-submodules -j8 --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 - pushd /tmp/kresd-local-build
- ( cd /tmp/kresd-local-build ; git submodule update --init --recursive ) - git log -1
- PREFIX=/tmp/.local make -C /tmp/kresd-local-build -k all - meson build_local --default-library=static --prefix=/tmp/.local
- PREFIX=/tmp/.local make -C /tmp/kresd-local-build install - ninja -C build_local install
- popd
# compare results from latest Deckard with results from merge base # compare results from latest Deckard with results from merge base
- cp ci/common.sh /tmp - cp ci/common.sh /tmp
- cp ci/compare-tests.sh /tmp - cp ci/compare-tests.sh /tmp
- cp ci/junit-compare.py /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 - PATH=/tmp/.local/sbin:$PATH /tmp/compare-tests.sh $(pwd)/kresd_run.sh
artifacts: artifacts:
when: always when: always
expire_in: '1 hour' expire_in: '1 hour'
...@@ -79,12 +80,13 @@ test:comparative:kresd: ...@@ -79,12 +80,13 @@ test:comparative:kresd:
test:latest:kresd: test:latest:kresd:
<<: *test <<: *test
script: script:
- git clone --depth=1 https://gitlab.labs.nic.cz/knot/knot-resolver.git kresd-local-build - git clone --recurse-submodules -j8 --depth=1 https://gitlab.labs.nic.cz/knot/knot-resolver.git kresd-local-build
- GIT_DIR=$(pwd)/kresd-local-build/.git git log -1 - pushd kresd-local-build
- ( cd kresd-local-build ; git submodule update --init --recursive ) - git log -1
- PREFIX=$(pwd)/.local make -C kresd-local-build -k all - meson build_local --default-library=static --prefix="$PWD/../.local"
- PREFIX=$(pwd)/.local make -C kresd-local-build install - ninja -C build_local install
- TMPDIR=$(pwd) LD_LIBRARY_PATH=$(pwd)/.local/lib PATH=$(pwd)/.local/sbin:$PATH ./kresd_run.sh -n $(nproc) - popd
- TMPDIR=$(pwd) PATH=$(pwd)/.local/sbin:$PATH ./kresd_run.sh -n $(nproc)
artifacts: artifacts:
when: on_failure when: on_failure
expire_in: 1 week expire_in: 1 week
......
...@@ -3,9 +3,9 @@ import glob ...@@ -3,9 +3,9 @@ import glob
import logging import logging
import os import os
import re import re
import yaml
import pytest import pytest
import yaml
Scenario = namedtuple("Scenario", ["path", "qmin", "config"]) Scenario = namedtuple("Scenario", ["path", "qmin", "config"])
......
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
# Copyright (C) 2017 # Copyright (C) 2017
import posixpath
import logging
import os
import collections.abc import collections.abc
import logging
import os # requires posix
from augeas import Augeas from augeas import Augeas
...@@ -22,7 +21,7 @@ def join(*paths): ...@@ -22,7 +21,7 @@ def join(*paths):
FIXME: Beware: // is normalized to / FIXME: Beware: // is normalized to /
""" """
norm_paths = [posixpath.normpath(path) for path in paths] norm_paths = [os.path.normpath(path) for path in paths]
# first path must be absolute # first path must be absolute
assert norm_paths[0][0] == '/' assert norm_paths[0][0] == '/'
new_paths = [norm_paths[0]] new_paths = [norm_paths[0]]
...@@ -31,9 +30,9 @@ def join(*paths): ...@@ -31,9 +30,9 @@ def join(*paths):
if path.startswith('/'): if path.startswith('/'):
path = path[1:] path = path[1:]
new_paths.append(path) new_paths.append(path)
new_path = posixpath.join(*new_paths) new_path = os.path.join(*new_paths)
log.debug("join: new_path %s", new_path) log.debug("join: new_path %s", new_path)
return posixpath.normpath(new_path) return os.path.normpath(new_path)
class AugeasWrapper: class AugeasWrapper:
......
...@@ -3,8 +3,7 @@ import binascii ...@@ -3,8 +3,7 @@ import binascii
import calendar import calendar
from datetime import datetime from datetime import datetime
import logging import logging
import os import os # requires posix
import posixpath
import random import random
import socket import socket
import struct import struct
...@@ -229,7 +228,7 @@ class Entry: ...@@ -229,7 +228,7 @@ class Entry:
def process_sections(self): def process_sections(self):
sections = set() sections = set()
for section in self.node.match("/section/*"): for section in self.node.match("/section/*"):
section_name = posixpath.basename(section.path) section_name = os.path.basename(section.path)
sections.add(section_name) sections.add(section_name)
for record in section.match("/record"): for record in section.match("/record"):
owner = record['/domain'].value owner = record['/domain'].value
...@@ -867,5 +866,5 @@ def parse_file(path): ...@@ -867,5 +866,5 @@ def parse_file(path):
kv = [x.strip() for x in line.split(':', 1)] kv = [x.strip() for x in line.split(':', 1)]
if len(kv) >= 2: if len(kv) >= 2:
config.append(kv) config.append(kv)
scenario = Scenario(node["/scenario"], posixpath.basename(node.path)) scenario = Scenario(node["/scenario"], os.path.basename(node.path))
return scenario, config return scenario, config
...@@ -5,7 +5,8 @@ Invoke with `python3 -m pytest forwarder_check.py --forwarder [IP of forwarder]` ...@@ -5,7 +5,8 @@ Invoke with `python3 -m pytest forwarder_check.py --forwarder [IP of forwarder]`
import ipaddress import ipaddress
import dns.message import dns.message
import pytest # NOTE silence incorrectly reported error, may be removed once it passes in CI
import pytest # pylint: disable=wrong-import-order
import answer_checker import answer_checker
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment