-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added admin operations script and test workflow * decreased number of QGIS images to test against decreased number of QGIS images to test against * full confs for running tests in ci * added test suite added test suite added test suite added test suite added test suite * expand QGIS test images matrix added test suite added test suite added test suite * update info about the test action workflow * reformatted using black * use correct link when installing plugin into the test QGIS image * change docker compose version * include test_ci for checking tests runs before making a PR * update test image before running the tests update test image before running the tests update test image before running the tests update test image before running the tests update test image before running the tests update test image before running the tests update test image before running the tests update test image before running the tests * added comment about display issue workaround * removed admin.py its changes will be implemented in another PR
- Loading branch information
Showing
4 changed files
with
112 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Runs tests on QGIS 3.16, 3.22 LTR, 3.26 and master branch | ||
name: Continous Integration | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- test_ci | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
branches: | ||
- main | ||
|
||
env: | ||
# Global environment variable | ||
IMAGE: qgis/qgis | ||
WITH_PYTHON_PEP: "true" | ||
MUTE_LOGS: "true" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Running tests on QGIS ${{ matrix.qgis_version_tag }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
qgis_version_tag: | ||
- release-3_22 | ||
- release-3_26 | ||
- latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Preparing docker-compose environment | ||
env: | ||
QGIS_VERSION_TAG: ${{ matrix.qgis_version_tag }} | ||
run: | | ||
cat << EOF > .env | ||
QGIS_VERSION_TAG=${QGIS_VERSION_TAG} | ||
IMAGE=${IMAGE} | ||
ON_TRAVIS=true | ||
MUTE_LOGS=${MUTE_LOGS} | ||
WITH_PYTHON_PEP=${WITH_PYTHON_PEP} | ||
EOF | ||
- name: Preparing test environment | ||
run: | | ||
cat .env | ||
docker pull "${IMAGE}":${{ matrix.qgis_version_tag }} | ||
docker-compose up -d | ||
sleep 10 | ||
- name: Run test suite | ||
run: | | ||
docker-compose exec -T qgis-testing-environment sh -c "apt-get update" | ||
docker-compose exec -T qgis-testing-environment sh -c "apt-get install -y python3-opencv" | ||
docker-compose exec -T qgis-testing-environment qgis_testrunner.sh LDMP.test.testplugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
version: '3' | ||
|
||
version: '2.1' | ||
services: | ||
qgis: | ||
volumes: | ||
- ./:/tests_directory | ||
environment: | ||
DISPLAY: ':99' | ||
build: | ||
context: . | ||
container_name: trendsearth_qgis_1 | ||
qgis-testing-environment: | ||
image: ${IMAGE}:${QGIS_VERSION_TAG} | ||
volumes: | ||
- ./:/tests_directory | ||
environment: | ||
QGIS_VERSION_TAG: "${QGIS_VERSION_TAG}" | ||
WITH_PYTHON_PEP: "${WITH_PYTHON_PEP}" | ||
ON_TRAVIS: "${ON_TRAVIS}" | ||
MUTE_LOGS: "${MUTE_LOGS}" | ||
DISPLAY: ":99" | ||
working_dir: /tests_directory | ||
entrypoint: /tests_directory/docker/qgis-testing-entrypoint.sh | ||
# Enable "command:" line below to immediately run unittests upon docker-compose up | ||
# command: qgis_testrunner.sh test_suite.test_package | ||
# Default behaviour of the container is to standby | ||
command: tail -f /dev/null | ||
# qgis_testrunner.sh needs tty for tee | ||
tty: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Docker entrypoint file intended for docker-compose recipe for running unittests | ||
|
||
set -e | ||
|
||
source /tests_directory/docker/trends-earth-test-pre-scripts.sh | ||
|
||
# Run supervisor | ||
# This is the default command of qgis/qgis but we will run it in background | ||
supervisord -c /etc/supervisor/supervisord.conf & | ||
|
||
# Wait for XVFB | ||
sleep 10 | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
qgis_setup.sh | ||
|
||
# FIX default installation because the sources must be in "trends.earth parent folder | ||
rm -rf /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/trends.earth | ||
ln -sf /tests_directory/LDMP /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/trends.earth | ||
ln -sf /tests_directory/LDMP /usr/share/qgis/python/plugins/trends.earth | ||
|
||
pip3 install -r /tests_directory/requirements.txt | ||
pip3 install -r /tests_directory/requirements-dev.txt |