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:
- # create required directories that are in default config, otherwise unit tests fail
- - mkdir -p /var/cache/knot-resolver
+ - poetry install --only main,dev,test
- poe test
# the following command makes sure that the source root of the coverage file is at $gitroot
- poetry run bash -c "coverage combine .coverage; coverage xml"
test = { cmd = "scripts/poe-tasks/test", help = "Run pytest unit tests" }
check = { cmd = "scripts/poe-tasks/check", help = "Check that all dependencies are installed and run static code analysis" }
examples = { cmd = "scripts/poe-tasks/examples", help = "Validate all configuration examples using 'kresctl validate' utility" }
-man = {cmd = "scripts/poe-tasks/man", help = "Display Knot Resolver manpage from sources" }
gen-setuppy = { cmd = "scripts/poe-tasks/gen-setuppy", help = "Generate 'setup.py' file for backwards compatibility" }
format = { cmd = "scripts/poe-tasks/format", help = "Run code formatter" }
kresctl = { cmd = "scripts/poe-tasks/kresctl", help="Run kresctl utility" }
aggregate_rv=$(( $aggregate_rv + $1 ))
}
-is_buil_dir_configured
-
# stop failing early, because we wouldn't do anything else than fail
set +e
echo -e "${red}These commands might help you:${reset}"
echo -e "${red}\tpoe format${reset}"
echo -e "${red}\tpoe gen-setuppy${reset}"
+ echo -e "${red}\tpoe doc-schema${reset}"
echo -e "${red}That's not great. Could you please fix that?${reset} 😲😟"
fi
src_dir="$(dirname "$(realpath "$0")")"
source $src_dir/utils/_env.sh
-is_buil_dir_configured
-
# validate all configuration examples
for example in $PWD/etc/config/config.example.*.yaml;
do
+++ /dev/null
-#!/usr/bin/env bash
-
-# ensure consistent behaviour
-src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/utils/_env.sh
-
-meson_setup_configure
-
-ninja_install
-
-man -l .install/share/man/man8/$1*
src_dir="$(dirname "$(realpath "$0")")"
source $src_dir/utils/_env.sh
-is_buil_dir_configured
-
# run pytest
env PYTHONPATH=. pytest --junitxml=unit.junit.xml --cov=python/knot_resolver --show-capture=all tests/manager