before_script:
- poetry --version
- poetry env use $PYTHON_INTERPRETER
+ - poetry install -E prometheus
+ - poe configure
tags:
- docker
- linux
examples:py3.12:
stage: check
script:
- - poetry install --only main,dev
- poe examples
variables:
PYTHON_INTERPRETER: python3.12
lint:py3.12:
stage: check
script:
- - poetry install --only main,dev,lint
- poe check
variables:
PYTHON_INTERPRETER: python3.12
.unit: &unit
stage: check
script:
- - poetry install --only main,dev,test
# create required directories that are in default config, otherwise unit tests fail
- mkdir -p /var/cache/knot-resolver
- poe test
aggregate_rv=$(( $aggregate_rv + $1 ))
}
+kres_is_meson_configured
+
# stop failing early, because we wouldn't do anything else than fail
set +e
src_dir="$(dirname "$(realpath "$0")")"
source $src_dir/utils/_env.sh
+kres_is_meson_configured
+
# validate all configuration examples
for example in $PWD/etc/config/config.example.*.yaml;
do
src_dir="$(dirname "$(realpath "$0")")"
source $src_dir/utils/_env.sh
+kres_is_meson_configured
+
# run knot-resolver client
python3 -m knot_resolver.client $@
src_dir="$(dirname "$(realpath "$0")")"
source $src_dir/utils/_env.sh
-build_knot_resolver_c
+kres_meson_build
man -l .install/share/man/man8/$1*
src_dir="$(dirname "$(realpath "$0")")"
source $src_dir/utils/_env.sh
+kres_is_meson_configured
+
# run pytest
env PYTHONPATH=. pytest --junitxml=unit.junit.xml --cov=python/knot_resolver --show-capture=all tests/manager
echo
}
-function kres_meson_build {
- if [ -d .build ]; then
- echo
- echo Building Knot Resolver C komponents
- echo -----------------------------------
- echo -e "${blue}In case of an compilation error, run this command to try to fix it:${reset}"
- echo -e "\t${blue}rm -r $install_dir $build_dir${reset}"
- echo
- ninja -C $build_dir
- ninja install -C $build_dir
- echo
- else
+function kres_is_meson_configured {
+ if [ ! -d .build ]; then
echo
echo Knot Resolver is not configured for building.
echo "Please run './poe configure' (optionally with additional Meson arguments)".
exit 2
fi
}
+
+function kres_meson_build {
+
+ kres_is_meson_configured
+
+ echo
+ echo Building Knot Resolver C komponents
+ echo -----------------------------------
+ echo -e "${blue}In case of an compilation error, run this command to try to fix it:${reset}"
+ echo -e "\t${blue}rm -r $install_dir $build_dir${reset}"
+ echo
+ ninja -C $build_dir
+ ninja install -C $build_dir
+ echo
+}