Skip to content

Commit

Permalink
Fix tests to setup on 3_22
Browse files Browse the repository at this point in the history
  • Loading branch information
azvoleff committed Nov 5, 2022
1 parent e45d7e4 commit 3fef84c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 40 deletions.
19 changes: 0 additions & 19 deletions LDMP/test/integration/test_calculate_ldn.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
# -*- coding: utf-8 -*-
"""
/***************************************************************************
LDMP - A QGIS plugin
This plugin supports monitoring and reporting of land degradation to the UNCCD
and in support of the SDG Land Degradation Neutrality (LDN) target.
-------------------
begin : 2017-05-23
git sha : $Format:%H$
copyright : (C) 2017 by Conservation International
email : [email protected]
***************************************************************************/
"""
import os
import sys
import tempfile

import numpy as np
from qgis.testing import unittest

from LDMP.calculate import ldn_make_prod5
from LDMP.calculate import ldn_recode_state
from LDMP.calculate import ldn_recode_traj
from LDMP.calculate import ldn_total_by_trans
from LDMP.calculate import ldn_total_deg_f
from LDMP.calculate_ldn import DlgCalculateLDNSummaryTableAdmin
from LDMP.calculate_ldn import ldn_total_by_trans_merge
from LDMP.test import add_default_bands_to_map


Expand Down
3 changes: 1 addition & 2 deletions docker/trends-earth-test-pre-scripts.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/usr/bin/env bash

qgis_setup.sh
qgis_setup.sh LDMP

# 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
18 changes: 1 addition & 17 deletions rundockertests-fast.bat
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
@echo off
REM Run docker tests on your local machine

set PLUGIN_NAME="LDMP"
set CONTAINER=trendsearth_qgis_1

set DOCKER_RUN_COMMAND=docker exec -it %CONTAINER% sh -c

REM docker-compose down -v
docker-compose up -d

%DOCKER_RUN_COMMAND% "qgis_setup.sh %PLUGIN_NAME%"
%DOCKER_RUN_COMMAND% "rm -f /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/%PLUGIN_NAME%"
%DOCKER_RUN_COMMAND% "ln -s /tests_directory/LDMP/ /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/%PLUGIN_NAME%"
docker cp trends.earth_test_user_credentials.json %CONTAINER%:/tests_directory/LDMP/test/trends.earth_test_user_credentials.json
docker cp trends.earth_admin_user_credentials.json %CONTAINER%:/tests_directory/LDMP/test/trends.earth_admin_user_credentials.json

REM Run the tests
%DOCKER_RUN_COMMAND% "cd /tests_directory && /usr/bin/test_runner/qgis_testrunner.sh LDMP.test.testplugin"
docker-compose exec -T qgis-testing-environment qgis_testrunner.sh LDMP.test.testplugin
3 changes: 1 addition & 2 deletions rundockertests.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@echo off
REM Run docker tests on your local machine

set QGIS_VERSION_TAG=release-3_26
set WITH_PYTHON_PEP=true
Expand All @@ -12,4 +11,4 @@ docker-compose up -d

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
docker-compose exec -T qgis-testing-environment qgis_testrunner.sh LDMP.test.testplugin

0 comments on commit 3fef84c

Please sign in to comment.