From 41471a2978bfe01272dd98d078c975458c7f5d03 Mon Sep 17 00:00:00 2001 From: Alex Zvoleff Date: Sun, 6 Nov 2022 18:32:16 -0500 Subject: [PATCH] Cleanup testing code --- docker/trends-earth-test-pre-scripts.sh | 4 --- rundockertests.sh | 17 +++-------- rundockertests_travis.bat | 38 ------------------------- 3 files changed, 4 insertions(+), 55 deletions(-) delete mode 100644 rundockertests_travis.bat diff --git a/docker/trends-earth-test-pre-scripts.sh b/docker/trends-earth-test-pre-scripts.sh index bfb259ca0..6601bfc86 100755 --- a/docker/trends-earth-test-pre-scripts.sh +++ b/docker/trends-earth-test-pre-scripts.sh @@ -8,7 +8,3 @@ ln -sf /tests_directory/LDMP /root/.local/share/QGIS/QGIS3/profiles/default/pyth pip3 install -r /tests_directory/requirements.txt pip3 install -r /tests_directory/requirements-dev.txt - -# Ensure that ui files are compiled -cd /tests_directory -invoke compile_files diff --git a/rundockertests.sh b/rundockertests.sh index 2bc950739..9dfbfaa0a 100755 --- a/rundockertests.sh +++ b/rundockertests.sh @@ -1,20 +1,11 @@ #!/bin/bash -# Run docker tests on your local machine -PLUGIN_NAME="LDMP" +cat .env -DOCKER_RUN_COMMAND="docker exec -it trendsearth_qgis_1 sh -c" +source .env -docker-compose down -v +docker pull "qgis/qgis":${QGIS_VERSION_TAG} docker-compose up -d -docker-compose ps - sleep 10 -# Setup -$DOCKER_RUN_COMMAND "qgis_setup.sh $PLUGIN_NAME" -$DOCKER_RUN_COMMAND "cd /tests_directory && git submodule update --init --recursive" -$DOCKER_RUN_COMMAND "cd /tests_directory && paver setup && paver package --tests" - -# Run the tests -$DOCKER_RUN_COMMAND "DISPLAY=:99 QT_X11_NO_MITSHM=1 GSHOSTNAME=boundless-test qgis_testrunner.sh LDMP.test.testplugin" +docker-compose exec -T qgis-testing-environment qgis_testrunner.sh LDMP.test.testplugin diff --git a/rundockertests_travis.bat b/rundockertests_travis.bat deleted file mode 100644 index ffc4dc571..000000000 --- a/rundockertests_travis.bat +++ /dev/null @@ -1,38 +0,0 @@ -@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 - -REM Setup docker instance -%DOCKER_RUN_COMMAND% "openssl aes-256-cbc -K $encrypted_e3ee5199e171_key -iv $encrypted_e3ee5199e171_iv -in travis_secrets.tar.gz.enc -out travis_secrets.tar.gz -d" -%DOCKER_RUN_COMMAND% "tar xzvf travis_secrets.tar.gz" -%DOCKER_RUN_COMMAND% "export AWS_SHARED_CREDENTIALS_FILE=aws_credentials.json" -%DOCKER_RUN_COMMAND% "qgis_setup.sh LDMP" -%DOCKER_RUN_COMMAND% "cd /tests_directory && git submodule update --init --recursive" -%DOCKER_RUN_COMMAND% "cd /tests_directory && invoke testdata-sync" -%DOCKER_RUN_COMMAND% "cd /tests_directory && invoke zipfile-build -c -t -f /LDMP.zip --python python3" -%DOCKER_RUN_COMMAND% "unzip -qq /LDMP.zip -d /"" -%DOCKER_RUN_COMMAND% "docker cp trends.earth_test_user_credentials.json trendsearth_qgis_1:/LDMP/test/trends.earth_test_user_credentials.json" -%DOCKER_RUN_COMMAND% "docker cp trends.earth_admin_user_credentials.json trendsearth_qgis_1:/LDMP/test/trends.earth_admin_user_credentials.json" -%DOCKER_RUN_COMMAND% "rm -f /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/LDMP" -%DOCKER_RUN_COMMAND% "ln -s /LDMP/ /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/LDMP" -%DOCKER_RUN_COMMAND% "cd /LDMP && qgis_testrunner.sh LDMP.test.testplugin" - -%DOCKER_RUN_COMMAND% "qgis_setup.sh %PLUGIN_NAME%" -%DOCKER_RUN_COMMAND% "cd /tests_directory && git submodule update --init --recursive" -%DOCKER_RUN_COMMAND% "cd /tests_directory && invoke testdata-sync" -%DOCKER_RUN_COMMAND% "cd /tests_directory && invoke zipfile-build -t -f /LDMP.zip --python python3" -%DOCKER_RUN_COMMAND% "unzip -qq -o /LDMP.zip -d /" -%DOCKER_RUN_COMMAND% "rm -f /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/%PLUGIN_NAME%" -%DOCKER_RUN_COMMAND% "ln -s /LDMP/ /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/%PLUGIN_NAME%" -docker cp trends.earth_test_user_credentials.json %CONTAINER%:/LDMP/test/trends.earth_test_user_credentials.json -docker cp trends.earth_admin_user_credentials.json %CONTAINER%:/LDMP/test/trends.earth_admin_user_credentials.json - -REM Run the tests -%DOCKER_RUN_COMMAND% "cd /LDMP && qgis_testrunner.sh LDMP.test.testplugin"