Skip to content
Permalink
Browse files

Merge pull request #41260 from qgis/test-focal

Update test base image and move CI to Github workflow
  • Loading branch information
nyalldawson committed Feb 8, 2021
2 parents e533b26 + 721c3c5 commit 5a46dee738f1317208065f8ec49230e1a5b300ac
Showing with 4,094 additions and 5,308 deletions.
  1. +9 −19 .ci/{travis/travis.ctest → config.ctest}
  2. +11 −9 .ci/{travis/scripts/ctest2travis.py → ctest2ci.py}
  3. 0 .ci/{travis/scripts → }/pr_has_label.py
  4. +4 −3 .ci/{travis/linux/scripts → }/test_blocklist.txt
  5. +0 −3 .ci/{travis/linux/scripts → }/test_flaky.txt
  6. +0 −21 .ci/travis/code_layout/before_install.sh
  7. +0 −15 .ci/travis/code_layout/before_script.sh
  8. +0 −24 .ci/travis/code_layout/install.sh
  9. +0 −25 .ci/travis/code_layout/script.sh
  10. +0 −16 .ci/travis/linux/before_install.sh
  11. +0 −45 .ci/travis/linux/before_script.sh
  12. +0 −31 .ci/travis/linux/docker-variables.env
  13. +0 −18 .ci/travis/linux/install.sh
  14. +0 −80 .ci/travis/linux/script.sh
  15. +0 −2 .ci/travis/macos/after_script.sh
  16. +0 −62 .ci/travis/macos/before_install.sh
  17. +0 −2 .ci/travis/macos/before_script.sh
  18. +0 −56 .ci/travis/macos/blocklist.txt
  19. +0 −66 .ci/travis/macos/install.sh
  20. +0 −44 .ci/travis/macos/script.sh
  21. +0 −11 .ci/travis/scripts/echo_travis_var.sh
  22. +16 −15 .ci/travis/linux/docker-compose.travis.yml → .docker/docker-compose-testing.yml
  23. +15 −34 {.ci/travis/linux/scripts → .docker}/docker-qgis-build.sh
  24. +33 −40 {.ci/travis/linux/scripts → .docker}/docker-qgis-test.sh
  25. +22 −0 .docker/docker-variables.env
  26. +0 −149 .docker/qgis3-build-deps-focal.dockerfile
  27. +16 −19 .docker/qgis3-build-deps.dockerfile
  28. +223 −0 .github/workflows/run-tests.yml
  29. +0 −79 .travis.yml
  30. +19 −12 CMakeLists.txt
  31. 0 CTestConfig.cmake → cmake_templates/CTestConfig.cmake.in
  32. +4 −1 python/core/auto_generated/qgsfeaturerequest.sip.in
  33. +2 −1 python/core/auto_generated/qgsproviderregistry.sip.in
  34. +7 −0 python/core/auto_generated/qgsrenderchecker.sip.in
  35. +6 −1 python/core/auto_generated/vector/qgsvectorlayerfeatureiterator.sip.in
  36. +1 −1 python/plugins/processing/algs/gdal/GdalUtils.py
  37. +1 −1 python/plugins/processing/algs/gdal/OgrToPostGis.py
  38. +1 −1 python/plugins/processing/algs/grass7/description/i.eb.hsebal01.txt
  39. +2 −0 python/plugins/processing/algs/qgis/FindProjection.py
  40. +33 −5 python/plugins/processing/tests/AlgorithmsTestBase.py
  41. +27 −15 python/plugins/processing/tests/GdalAlgorithmsRasterTest.py
  42. +14 −1 python/plugins/processing/tests/GdalAlgorithmsVectorTest.py
  43. +1 −0 python/plugins/processing/tests/testdata/expected/gdal/demproj6.prj
  44. +163 −163 python/plugins/processing/tests/testdata/expected/grass7/v_net_nodes.gml
  45. +52 −0 python/plugins/processing/tests/testdata/expected/grass7/v_rast_stats2.gml
  46. +108 −0 python/plugins/processing/tests/testdata/expected/grass7/v_rast_stats2.xsd
  47. +2 −2 python/plugins/processing/tests/testdata/expected/multipoint_delaunay.gfs
  48. +86 −86 python/plugins/processing/tests/testdata/expected/multipoint_delaunay.gml
  49. +33 −0 python/plugins/processing/tests/testdata/expected/tapered_buffer_multilinev2.gml
  50. +23 −0 python/plugins/processing/tests/testdata/expected/tapered_buffer_multilinev2.xsd
  51. BIN python/plugins/processing/tests/testdata/expected/xyztiles/1/0/0_mask.png
  52. BIN python/plugins/processing/tests/testdata/expected/xyztiles/2/0/1_mask.png
  53. BIN python/plugins/processing/tests/testdata/expected/xyztiles/2/1/1_mask.png
  54. BIN python/plugins/processing/tests/testdata/expected/xyztiles/3/1/2_mask.png
  55. BIN python/plugins/processing/tests/testdata/expected/xyztiles/3/1/3_mask.png
  56. BIN python/plugins/processing/tests/testdata/expected/xyztiles/3/2/2_mask.png
  57. BIN python/plugins/processing/tests/testdata/expected/xyztiles/3/2/3_mask.png
  58. +8 −4 python/plugins/processing/tests/testdata/gdal_algorithm_raster_tests.yaml
  59. +3 −1 python/plugins/processing/tests/testdata/gdal_algorithm_vector_tests.yaml
  60. +49 −32 python/plugins/processing/tests/testdata/grass7_algorithms_imagery_tests.yaml
  61. +50 −37 python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml
  62. +4 −2 python/plugins/processing/tests/testdata/grass7_algorithms_vector_tests.yaml
  63. +27 −0 python/plugins/processing/tests/testdata/qgis_algorithm_tests1.yaml
  64. +28 −12 python/plugins/processing/tests/testdata/qgis_algorithm_tests3.yaml
  65. +24 −5 python/plugins/processing/tests/testdata/qgis_algorithm_tests4.yaml
  66. +157 −87 python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml
  67. +82 −25 python/testing/__init__.py
  68. +3 −5 src/analysis/vector/geometry_checker/qgsgeometryduplicatecheck.cpp
  69. +1 −1 src/core/expression/qgsexpressionfunction.cpp
  70. +7 −5 src/core/geocoding/qgsgooglemapsgeocoder.cpp
  71. +0 −1 src/core/geocoding/qgsgooglemapsgeocoder.h
  72. +24 −28 src/core/geometry/qgsgeos.cpp
  73. +22 −14 src/core/qgsaggregatecalculator.cpp
  74. +8 −1 src/core/qgsfeaturerequest.h
  75. +18 −1 src/core/qgsproviderregistry.h
  76. +11 −5 src/core/qgsrenderchecker.cpp
  77. +7 −0 src/core/qgsrenderchecker.h
  78. +4 −9 src/core/vector/qgsvectorlayerfeatureiterator.cpp
  79. +22 −5 src/core/vector/qgsvectorlayerfeatureiterator.h
  80. +11 −3 src/gui/qgsmaptoolcapture.cpp
  81. +14 −11 src/quickgui/qgsquickutils.cpp
  82. +3 −3 src/test/qgstest.h
  83. +5 −0 tests/src/3d/testqgs3drendering.cpp
  84. +1 −1 tests/src/analysis/testqgsprocessingalgs.cpp
  85. +3 −1 tests/src/core/testqgsarcgisrestutils.cpp
  86. +6 −0 tests/src/core/testqgsauthmanager.cpp
  87. +3 −0 tests/src/core/testqgscoordinatereferencesystem.cpp
  88. +13 −1 tests/src/core/testqgsexpression.cpp
  89. +44 −23 tests/src/core/testqgsgeometry.cpp
  90. +3 −3 tests/src/core/testqgsgeonodeconnection.cpp
  91. +5 −5 tests/src/core/testqgsnetworkaccessmanager.cpp
  92. +1 −0 tests/src/python/CMakeLists.txt
  93. +2 −2 tests/src/python/qgis_wrapped_server.py
  94. +4 −4 tests/src/python/test_authmanager_oauth2_ows.py
  95. +5 −3 tests/src/python/test_authmanager_password_postgres.py
  96. +6 −8 tests/src/python/test_authmanager_pki_ows.py
  97. +11 −109 tests/src/python/test_authmanager_pki_postgres.py
  98. +1 −1 tests/src/python/test_db_manager_gpkg.py
  99. +8 −8 tests/src/python/test_provider_mssql.py
  100. +4 −0 tests/src/python/test_provider_ogr_gpkg.py
  101. +1 −1 tests/src/python/test_provider_postgres.py
  102. +12 −0 tests/src/python/test_provider_python.py
  103. +2 −0 tests/src/python/test_provider_shapefile.py
  104. +2 −2 tests/src/python/test_provider_spatialite.py
  105. +2 −1 tests/src/python/test_provider_virtual.py
  106. +13 −10 tests/src/python/test_qgsactionmanager.py
  107. +12 −6 tests/src/python/test_qgscoordinateoperationwidget.py
  108. +4 −4 tests/src/python/test_qgsfiledownloader.py
  109. +13 −3 tests/src/python/test_qgsgeometry.py
  110. +2 −2 tests/src/python/test_qgslabellinesettings.py
  111. +3 −3 tests/src/python/test_qgsproviderconnection_postgres.py
  112. +1 −1 tests/src/python/test_qgsqueryresultmodel.py
  113. +53 −42 tests/src/python/test_qgsrelationeditwidget.py
  114. +1 −1 tests/src/python/test_qgsserver_wms_getfeatureinfo.py
  115. +2 −1 tests/src/python/test_qgsserver_wms_getmap.py
  116. +1 −1 tests/src/python/test_qgsserver_wms_getprint.py
  117. +1 −1 tests/src/python/test_qgstaskmanager.py
  118. +1 −1 tests/src/python/test_qgsvectorfilewriter.py
  119. +0 −25 tests/src/python/test_qgsvectorlayer.py
  120. +58 −0 tests/src/python/test_qgsvectorlayershapefile.py
  121. +4 −4 tests/testdata/Dockerfile-postgis
  122. +8 −0 tests/testdata/auth_system/README.md
  123. +21 −0 tests/testdata/auth_system/certs_keys_2048/127_0_0_1.crt
  124. +17 −0 tests/testdata/auth_system/certs_keys_2048/127_0_0_1.csr
  125. +27 −0 tests/testdata/auth_system/certs_keys_2048/127_0_0_1.key
  126. +21 −0 tests/testdata/auth_system/certs_keys_2048/Gerardus.crt
  127. +17 −0 tests/testdata/auth_system/certs_keys_2048/Gerardus.csr
  128. +27 −0 tests/testdata/auth_system/certs_keys_2048/Gerardus.key
  129. +48 −0 tests/testdata/auth_system/certs_keys_2048/Gerardus.pem
  130. +45 −0 tests/testdata/auth_system/certs_keys_2048/Gerardus_bundle.crt
  131. +21 −0 tests/testdata/auth_system/certs_keys_2048/docker.crt
  132. +17 −0 tests/testdata/auth_system/certs_keys_2048/docker.csr
  133. +27 −0 tests/testdata/auth_system/certs_keys_2048/docker.key
  134. +48 −0 tests/testdata/auth_system/certs_keys_2048/docker.pem
  135. +68 −0 tests/testdata/auth_system/certs_keys_2048/gen_certs.sh
  136. +21 −0 tests/testdata/auth_system/certs_keys_2048/postgres.crt
  137. +17 −0 tests/testdata/auth_system/certs_keys_2048/postgres.csr
  138. +27 −0 tests/testdata/auth_system/certs_keys_2048/postgres.key
  139. +24 −0 tests/testdata/auth_system/certs_keys_2048/qgis_ca.crt
  140. +27 −0 tests/testdata/auth_system/certs_keys_2048/qgis_ca.key
  141. +1 −0 tests/testdata/auth_system/certs_keys_2048/qgis_ca.srl
  142. BIN ...s/testdata/control_images/3d/expected_polygon3d_extrusion/github/expected_polygon3d_extrusion.png
  143. BIN ...s/testdata/control_images/annotations/expected_html_feature/travis/expected_html_feature_mask.png
  144. BIN .../control_images/qgis_server/WMS_GetMap_Dimension_All_NoValue/WMS_GetMap_Dimension_All_NoValue.png
  145. BIN ...qgis_server/WMS_GetMap_Dimension_Elevation_MixValues/WMS_GetMap_Dimension_Elevation_MixValues.png
  146. BIN ..._server/WMS_GetMap_Dimension_Elevation_MultiValues/WMS_GetMap_Dimension_Elevation_MultiValues.png
  147. BIN ..._Dimension_Elevation_RangeElevation_Value/WMS_GetMap_Dimension_Elevation_RangeElevation_Value.png
  148. BIN ...is_server/WMS_GetMap_Dimension_Elevation_RangeValue/WMS_GetMap_Dimension_Elevation_RangeValue.png
  149. BIN ...GetMap_Dimension_Elevation_RangeValue_Filter/WMS_GetMap_Dimension_Elevation_RangeValue_Filter.png
  150. BIN ..._images/qgis_server/WMS_GetMap_Dimension_Elevation_Value/WMS_GetMap_Dimension_Elevation_Value.png
  151. BIN ...r/WMS_GetMap_Dimension_RangeElevation_MixValues/WMS_GetMap_Dimension_RangeElevation_MixValues.png
  152. BIN ...S_GetMap_Dimension_RangeElevation_MultiValues/WMS_GetMap_Dimension_RangeElevation_MultiValues.png
  153. BIN ...WMS_GetMap_Dimension_RangeElevation_RangeValue/WMS_GetMap_Dimension_RangeElevation_RangeValue.png
  154. BIN ...is_server/WMS_GetMap_Dimension_RangeElevation_Value/WMS_GetMap_Dimension_RangeElevation_Value.png
  155. BIN ...estdata/control_images/qgis_server/WMS_GetMap_Highlight_Point/WMS_GetMap_Highlight_Point_mask.png
  156. BIN ...ges/qgis_server/WMS_GetMap_Mode_8bit_with_transparency/WMS_GetMap_Mode_8bit_with_transparency.png
  157. BIN ...gis_server/WMS_GetMap_Mode_8bit_with_transparency/WMS_GetMap_Mode_8bit_with_transparency_mask.png
  158. BIN tests/testdata/control_images/qgis_server/WMS_GetPrint_Highlight/v2/WMS_GetPrint_Highlight_mask.png
  159. BIN .../testdata/control_images/qgis_server/WMS_GetPrint_StyleDefault/WMS_GetPrint_StyleDefault_mask.png
  160. BIN tests/testdata/provider/bug_21227-rename-styles.gpkg
  161. +1,696 −3,520 tests/testdata/qgis_server/landingpage/test_landing_page_with_pg_index.json
  162. +1 −1 tests/testdata/qgis_server/landingpage/test_project_Project1_Title.json
  163. +1 −1 tests/testdata/qgis_server/landingpage/test_project_Project2_Title.json
  164. +1 −1 tests/testdata/qgis_server/landingpage/test_project_Project3_Title.json
  165. +1 −1 tests/testdata/qgis_server/landingpage/test_project_QGIS_Server_-_Grouped_Nested_Layer.json
  166. +1 −1 tests/testdata/qgis_server/wms_getcapabilities_without_title.txt
  167. +1 −1 tests/testdata/qgis_server/wms_getfeatureinfo_line_tolerance_20_text_xml.txt
  168. +1 −1 tests/testdata/qgis_server/wms_getfeatureinfo_polygon_tolerance_20_text_xml.txt
  169. +28 −28 tests/testdata/qgis_server_accesscontrol/results/getcapabilities_wms_dimension.txt
@@ -5,19 +5,10 @@ SET (CTEST_BINARY_DIRECTORY $ENV{CTEST_BUILD_DIR}/build)

SET (CTEST_CMAKE_COMMAND "cmake")
SET (CTEST_BUILD_COMMAND $ENV{CTEST_BUILD_COMMAND})
SET (CTEST_SITE "travis-ci.org")
IF ($ENV{TRAVIS_PULL_REQUEST} STREQUAL "false")
# No pull request
SET (CTEST_BUILD_NAME "$ENV{TRAVIS_BRANCH} ($ENV{BUILD}) ($ENV{TRAVIS_COMMIT})")
ELSE()
SET (CTEST_BUILD_NAME "PR: $ENV{TRAVIS_PULL_REQUEST} / $ENV{TRAVIS_BRANCH} ($ENV{BUILD}) ($ENV{TRAVIS_COMMIT})")
ENDIF()
SET (CTEST_SITE "github.com")
SET (CTEST_BUILD_NAME "$ENV{CTEST_BUILD_NAME}")
SET (CTEST_BUILD_CONFIGURATION "Release")
IF ($ENV{TRAVIS_CONFIG} STREQUAL "code_layout")
SET (CTEST_TEST_TIMEOUT 600) # 600 seconds, spelling test might take some time
ELSE()
SET (CTEST_TEST_TIMEOUT 60) # 60 seconds
ENDIF()
SET (CTEST_TEST_TIMEOUT 60) # 60 seconds
IF(DEFINED ENV{CTEST_PARALLEL_LEVEL})
SET(PARALLEL_LEVEL $ENV{CTEST_PARALLEL_LEVEL})
ELSE(DEFINED ENV{CTEST_PARALLEL_LEVEL})
@@ -61,10 +52,10 @@ ctest_start(Experimental)
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE BUILDRES NUMBER_WARNINGS NUMWARN NUMBER_ERRORS NUMERR)

# Create link to test results
# CDash on OTB requires the date to be set for the search to work and that's the timezone this requires
SET(ENV{TZ} "UTC-6")
# CDash on OTB requires the date to be set for the search to work (used to be UTC-6, seems to be UTC now)
SET(ENV{TZ} "UTC")
EXECUTE_PROCESS(COMMAND date +%Y-%m-%d OUTPUT_VARIABLE CDASH_DATE)
SET(RESULT_LINK "http://cdash.orfeo-toolbox.org/index.php?project=QGIS&filtercount=1&showfilters=1&field1=buildname/string&compare1=63&value1=$ENV{TRAVIS_COMMIT}&date=${CDASH_DATE}")
SET(RESULT_LINK "http://cdash.orfeo-toolbox.org/index.php?project=QGIS&filtercount=1&showfilters=1&field1=buildname/string&compare1=63&value1=$ENV{CTEST_BUILD_NAME}&date=${CDASH_DATE}")
EXECUTE_PROCESS(COMMAND curl --data-urlencode "url=${RESULT_LINK}" -s http://tinyurl.com/api-create.php
OUTPUT_VARIABLE SHORTURL)

@@ -73,8 +64,7 @@ IF(NOT IGNORE_BUILD_FAILURES)
IF(NOT ${BUILDRES} EQUAL 0 OR NOT ${NUMERR} EQUAL 0)
ctest_submit (RETRY_COUNT 3 RETRY_DELAY 30)
MESSAGE("")
MESSAGE(" ${Yellow}Test results submitted to${ColorReset}")
MESSAGE(" ${BoldYellow}${SHORTURL}${ColorReset}")
MESSAGE(" ${Yellow}Test results submitted to:${ColorReset} ${SHORTURL}")
MESSAGE("")
MESSAGE( FATAL_ERROR " ${Red}Build failed. Not running tests.${ColorReset}" )
MESSAGE("")
@@ -84,8 +74,7 @@ ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL ${PARALLEL_LEVEL} R
IF(NOT ${NUMWARN} EQUAL 0 OR NOT ${TESTRES} EQUAL 0)
ctest_submit (RETRY_COUNT 3 RETRY_DELAY 30)
MESSAGE("")
MESSAGE(" ${Yellow}Test results submitted to${ColorReset}")
MESSAGE(" ${BoldYellow}${SHORTURL}${ColorReset}" )
MESSAGE(" ${Yellow}Test results submitted to:${ColorReset} ${SHORTURL}" )
MESSAGE("")
SET(LEVEL "")
IF(NOT ${TESTRES} EQUAL 0)
@@ -106,4 +95,5 @@ IF(NOT ${TESTRES} EQUAL 0)
MESSAGE(" ${BoldGreen}Success${ColorReset}")
MESSAGE(" ${Green}All tests passed successfully.${ColorReset}")
MESSAGE("")
MESSAGE("")
ENDIF(NOT ${TESTRES} EQUAL 0)
@@ -3,7 +3,7 @@

"""
***************************************************************************
ctest2travis.py
ctest2ci.py
---------------------
Date : March 2017
Copyright : (C) 2017 by Matthias Kuhn
@@ -27,30 +27,28 @@
# This script parses output from ctest and injects
#
# - Colors for failing unit tests and test cases
#
# - `travis_fold` control sequences to hide uninteresting output by default
# - Group control sequences to hide uninteresting output by default

import sys
import re
import shlex
import subprocess
from termcolor import colored

fold_stack = list()


def start_fold(tag):
sys.stdout.write('travis_fold:start:{}\n'.format(tag))
sys.stdout.write('::group::{}\n'.format(tag))
fold_stack.append(tag)


def end_fold():
try:
tag = fold_stack.pop()
sys.stdout.write('travis_fold:end:{}\n'.format(tag))
sys.stdout.write('::endgroup::\n')
except IndexError:
updated_line = colored("======================", 'magenta')
updated_line += colored("ctest2travis error when processing the following line:", 'magenta')
updated_line += colored("ctest2ci error when processing the following line:", 'magenta')
updated_line += colored("----------------------", 'magenta')
updated_line += colored(updated_line, 'magenta')
updated_line += colored("----------------------", 'magenta')
@@ -63,7 +61,7 @@ def end_fold():

def start_test_fold():
global test_count
sys.stdout.write('Running tests')
sys.stdout.write('Running tests\n')
start_fold('test.{}'.format(test_count))
test_count += 1

@@ -80,7 +78,7 @@ def start_test_fold():
updated_line = '{title}\n{line}'.format(title=colored('Running tests...', 'yellow', attrs=['bold']),
line=updated_line)

elif re.match('Test project /home/travis/build/qgis/QGIS/build', updated_line):
elif re.match('Test project /home/runner/QGIS/QGIS/build', updated_line):
end_fold() # tag=build
start_test_fold()

@@ -110,6 +108,8 @@ def start_test_fold():
in_failure = True

if not in_failing_test and re.search('[0-9]+% tests passed, [0-9]+ tests failed out of', updated_line):
tests_failing = re.match(r'.* ([0-9]+) tests failed', updated_line).group(1)
updated_line += '\n::set-output name=TESTS_FAILING::{}'.format(tests_failing)
end_fold()

if re.search('100% tests passed', updated_line):
@@ -118,6 +118,8 @@ def start_test_fold():
if re.match('Submit files', updated_line):
start_fold('submit')
elif re.search('Test results submitted to', updated_line):
cdash_url = re.match(r'.*(http.*)$', updated_line).group(1)
updated_line += '\n::set-output name=CDASH_URL::{}'.format(cdash_url)
end_fold()

sys.stdout.write(updated_line)
File renamed without changes.
@@ -11,7 +11,6 @@ qgis_sip_include
qgis_sip_uptodate

# Need a local postgres installation
PyQgsAuthManagerPKIPostgresTest
PyQgsAuthManagerOgrPostgresTest
PyQgsDbManagerPostgis

@@ -24,5 +23,7 @@ qgis_layerdefinition
# MSSQL requires the MSSQL docker
PyQgsProviderConnectionMssql

# Broken - segfaults on Travis, likely due to a real issue in the server code
# PyQgsServerWMSGetPrint
# Oracle image is temporarily disabled in the Github Actions builds
PyQgsOracleProvider


@@ -7,6 +7,3 @@ qgis_ziplayertest
# Flaky, the ms odbc driver crashes a lot on the ubuntu docker image. Retest when
# the docker base image is upgraded
PyQgsMssqlProvider

# Flaky
PyQgsPostgresRasterProvider

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 5a46dee

Please sign in to comment.