Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with QGIS docker and documentation #57931

Closed
1 of 2 tasks
manylon opened this issue Jun 28, 2024 · 3 comments
Closed
1 of 2 tasks

Problem with QGIS docker and documentation #57931

manylon opened this issue Jun 28, 2024 · 3 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@manylon
Copy link

manylon commented Jun 28, 2024

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

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@manylon manylon added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jun 28, 2024
@elpaso
Copy link
Contributor

elpaso commented Jul 3, 2024

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

@manylon
Copy link
Author

manylon commented Aug 12, 2024

My guess is that it is coming from .docker/qgis.dockerfile because I succeded building without using it.

@reinout
Copy link

reinout commented Oct 2, 2024

I've just opened qgis/qgis-docker#114 as I ran into a similar issue: missing qgis_setup.sh.
To me, it looks like the Dockerfile in this repository is not being used anymore, but instead https://github.com/qgis/qgis-docker/blob/main/desktop/Dockerfile

And.... that one installs qgis from a debian package, which doesn't include the custom shell scripts copied by "our" dockerfile from somewhere in the .docker/ directory:

# Add QGIS test runner
COPY .docker/qgis_resources/test_runner/qgis_* /usr/bin/

@manylon manylon closed this as completed Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

No branches or pull requests

3 participants