diff --git a/lib/dl_api_lib/pyproject.toml b/lib/dl_api_lib/pyproject.toml index 657b28404..74290fa48 100644 --- a/lib/dl_api_lib/pyproject.toml +++ b/lib/dl_api_lib/pyproject.toml @@ -58,6 +58,8 @@ requires = [ ] [tool.pytest.ini_options] +# log_cli = true +# log_level = "DEBUG" minversion = "6.0" addopts = "-ra" testpaths = ["dl_api_lib_tests/unit", "dl_api_lib_tests/db"] diff --git a/metapkg/pyproject.toml b/metapkg/pyproject.toml index c74af3e8f..dd581d422 100644 --- a/metapkg/pyproject.toml +++ b/metapkg/pyproject.toml @@ -203,8 +203,6 @@ requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.pytest.ini_options] -# log_cli = true -# log_level = "ERROR" minversion = "6.0" addopts = "-ra" testpaths = [] diff --git a/tools/taskfiles/taskfile_dev.yml b/tools/taskfiles/taskfile_dev.yml index 156f8ac5b..3ccf1e17f 100644 --- a/tools/taskfiles/taskfile_dev.yml +++ b/tools/taskfiles/taskfile_dev.yml @@ -135,3 +135,30 @@ tasks: desc: Stop and remove all docker containers cmds: - docker stop $(docker ps -a -q) + + ssh_forward_start: + desc: Forward docker ports to localhost + requires: + vars: + - HOST + cmds: + - for port in $PORTS; do + echo "Forwarding port $port"; + ssh -f -N -L $port:localhost:$port {{.HOST}}; + done; + wait + var: + env: + PORTS: + sh: DOCKER_HOST=ssh://{{.HOST}} docker ps --format "{{`{{.Ports}}`}}" + | grep -o ':[0-9]*->' + | sed 's/->//g' + | sed 's/://g' + | uniq + + ssh_forward_stop: + desc: Stop SSH port forwarding for Docker containers + cmds: + - echo "Next processes will be killed:" + - ps -ef | grep "ssh -f -N -L" | grep --invert-match "grep" + - pkill -f "ssh -f -N -L"