qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.03k stars 2.92k forks source link

Problem with QGIS docker and documentation #57931

Open manylon opened 1 week ago

manylon commented 1 week ago

What is the bug or the crash?

I am using the qgis_testrunner.sh script to run unit tests for a QGIS-Plugin.

The qgis_testrunner.sh was either missing or returning this ERROR: no output from the test runner! (exit code: 0) I followed the documentation from QGIS Docker images

This is a similar issue to #54314

Steps to reproduce the issue

Reproducing the problem: Cleaning cache from docker, just in case:

$ docker builder prune 
$ cd QGIS
$ docker build -t qgis/qgis:release-3_36 --build-arg DOCKER_TAG=release-3_36 -f .docker/qgis.dockerfile .

Response starts with:

[internal] load .dockerignore  => => transferring context: 71B  => [internal] load build definition from qgis.dockerfile  => => transferring dockerfile: 2.33kB  => [internal] load metadata for docker.io/qgis/qgis3-build-deps:latest  

Reminder I am using version = release-3_36

I guess it comes from .docker/qgis.dockerfile

ARG DOCKER_DEPS_TAG=latest

Running the container:

$ xhost + 127.0.0.1
$ docker run --rm -it --name qgis36 -v /dir:/tests_directory/plugin_name -e DISPLAY=host.docker.internal:0 qgis/qgis:release-3_36

Check if the build is successful:

$ docker exec -it qgis36 sh -c "cd /QGIS && cat build_exit_value"

Response:

FAILED

Test test_runner.sh:

$ docker exec -it qgis36 sh -c "cd /tests_directory && qgis_testrunner.sh"

Response:

qgis_testrunner.sh: not found

In some cases the response was:

ERROR: no output from the test runner! (exit code: 0)

Did the same with the latest version:

$ docker builder prune 
$ docker build -t qgis/qgis:latest --build-arg DOCKER_TAG=release-3_36 -f .docker/qgis.dockerfile .
$ xhost + 127.0.0.1
$ docker run --rm -it --name qgislatest -v /dir:/tests_directory/plugin_name -e DISPLAY=host.docker.internal:0 qgis/qgis:latest

Check if the build is successful:

$ docker exec -it qgislatest sh -c "cd /QGIS && cat build_exit_value"

Response:

FAILED

$ docker exec -it qgislatest sh -c "cd /tests_directory && qgis_testrunner.sh"

Response: qgis_testrunner.sh: not found

The successful solution was without using .docker/qgis.dockerfile:

$ docker builder prune 
$ docker pull qgis/qgis:release-3_36 
$ xhost + 127.0.0.1
$ docker run --rm -it --name qgis36 -v /dir:/tests_directory/plugin_name -e DISPLAY=host.docker.internal:0 qgis/qgis:release-3_36

Check if the build is succesful:

$ docker exec -it qgis36 sh -c "cd /QGIS && cat build_exit_value"

Response:

OK

Test qgis_testrunner:

$ docker exec -it qgis36 sh -c "qgis_testrunner.sh"

Response:

ValueError: Empty module name Finished running test (codes: IS_DEAD=1 IS_FAILED=0 IS_PASSED=1).

Setup developing plugin:

$ docker exec -it qgis36 sh -c "qgis_setup.sh plugin_name"

Test plugin

$ docker exec -it qgis36 sh -c "cd /tests_directory && qgis_testrunner.sh plugin_name.tests.test_something"

Response:

Works

Versions

release-3_36 , latest

Supported QGIS version

New profile

Additional context

No response

elpaso commented 4 days ago

Is this an issue with https://github.com/qgis/qgis-docker ? If it is, can you move it there?