-
-
Notifications
You must be signed in to change notification settings - Fork 30
feat: download the qgis_setup.sh to run plugin tests #129
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
base: main
Are you sure you want to change the base?
Conversation
desktop/Dockerfile
Outdated
| apt-get clean | ||
|
|
||
| # Upstream script to run plugin tests (only for tags & master) | ||
| RUN ([[ "$qgis_version" == "master" ]] && upstream_version="master" || { [[ "$qgis_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && UPSTREAM="final-${VERSION//./_}"; }) && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh, I put this together very quickly and didn't really go through the entire logic that determines $qgis_version. currently it allows master as that's the qgis_version default in the Dockerfile and turns 3.44.1 into final-3_44_1 (upstream tag).
or maybe you'd rather like to port that script into this repo? probably makes more sense? it's not used upstream in any other code, but no idea what other workflows might depend on that script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather move this logic in the workflow to determine a new variable qgis_branch which would be used as an arugment here.
also, in the current code it seems there is a mismatch between upstream_version and UPSTREAM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, see the new commit 82662a3
|
urgh, will make it work locally first 😅 |
|
Hi @nilsnolde, i'm also looking for accept on this PR, it'd help me so much in testing qgis plugins |
| QGIS_REF="NA" | ||
| TEST_URL="refs/heads" | ||
| if ! [[ "$QGIS_VERSION" == "master" || ]]; then | ||
| QGIS_REF=master | ||
| elif [[ "$QGIS_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
| QGIS_REF="final-${QGIS_VERSION//./_}" | ||
| TEST_URL="refs/tags" | ||
| fi | ||
| if ! wget -q --spider https://api.github.com/repos/qgis/QGIS/git/${TEST_URL}/${QGIS_REF}; then | ||
| echo "Invalid git ref '${QGIS_REF}' for version '${QGIS_VERSION}'" | ||
| exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as requested, the logic to get the git ref is now in in the workflow.
as you can see, this simply assumes that any QGIS_VERSION will map to final-x_y_z tags (or simply master), it doesn't care about ltr-x_y tags. I'm not entirely sure what QGIS_VERSION can be, maybe you have a better idea here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, this shell code became a bit too big to be inlined. it's quite cumbersome to test changes locally. IMHO it'd be better to outsource this to a proper script and at least run shellcheck or so on the scripts, ideally even testing the image a bit (more) before pushing it. What do you think?
| FROM ${os}:${release} | ||
| LABEL maintainer="OPENGIS.ch <info@opengis.ch>" | ||
|
|
||
| ARG os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not used anymore after
| ARG os | ||
| ARG release | ||
| ARG repo | ||
| ARG qgis_version=master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to where it's used, for layer caching purposes
| ARG qgis_ref | ||
|
|
||
| RUN /opt/check_version.sh ${qgis_version} | ||
| RUN /opt/qgis_test_setup.sh ${qgis_ref} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will download and install the necessary scripts from qgis_ref
| This image can be used to set up a testing environment for plugins, e.g. | ||
|
|
||
| ``` | ||
| PLUGIN_DIR=<plugin_name> # e.g. PLUGIN_NAME=valhalla |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this with https://github.com/nilsnolde/valhalla-qgis-plugin, should work similarly for all plugins
fixes #114