Skip to content

Commit

Permalink
drop TRAVIS env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored and nyalldawson committed Feb 8, 2021
1 parent edc7192 commit 18dd7d3
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 27 deletions.
4 changes: 1 addition & 3 deletions .docker/docker-variables.env
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ CTEST_BUILD_NAME
# Other var # Other var
QGIS_NO_OVERRIDE_IMPORT=1 QGIS_NO_OVERRIDE_IMPORT=1


# We were using TRAVIS=true to skip some tests # This is used in some tests to be skipped
# let's keep it for now but also use a new var
QGIS_CONTINUOUS_INTEGRATION_RUN=true QGIS_CONTINUOUS_INTEGRATION_RUN=true
TRAVIS=true


LANG=C.UTF-8 LANG=C.UTF-8
LC_ALL=en_US.UTF-8 LC_ALL=en_US.UTF-8
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_db_manager_gpkg.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def testListLayer(self):


connection.remove() connection.remove()


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'),
'Test flaky') # see https://travis-ci.org/qgis/QGIS/jobs/502556996 'Test flaky') # see https://travis-ci.org/qgis/QGIS/jobs/502556996
def testCreateRenameDeleteTable(self): def testCreateRenameDeleteTable(self):
connection_name = 'testCreateRenameDeleteTable' connection_name = 'testCreateRenameDeleteTable'
Expand Down
16 changes: 8 additions & 8 deletions tests/src/python/test_provider_mssql.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def setUpClass(cls):
cls.poly_provider = cls.poly_vl.dataProvider() cls.poly_provider = cls.poly_vl.dataProvider()


# Triggers a segfault in the sql server odbc driver on Travis - TODO test with more recent Ubuntu base image # Triggers a segfault in the sql server odbc driver on Travis - TODO test with more recent Ubuntu base image
if os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'): if os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'):
del cls.getEditableLayer del cls.getEditableLayer


# Use connections API # Use connections API
Expand Down Expand Up @@ -215,22 +215,22 @@ def uncompiledFilters(self):
return filters return filters


def testGetFeaturesUncompiled(self): def testGetFeaturesUncompiled(self):
if os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'): if os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'):
return return
super().testGetFeaturesUncompiled() super().testGetFeaturesUncompiled()


def testGetFeaturesExp(self): def testGetFeaturesExp(self):
if os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'): if os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'):
return return
super().testGetFeaturesExp() super().testGetFeaturesExp()


def testOrderBy(self): def testOrderBy(self):
if os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'): if os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'):
return return
super().testOrderBy() super().testOrderBy()


def testOrderByCompiled(self): def testOrderByCompiled(self):
if os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'): if os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'):
return return
super().testOrderByCompiled() super().testOrderByCompiled()


Expand Down Expand Up @@ -290,7 +290,7 @@ def testFloatDecimalFields(self):
self.assertIsInstance(f.attributes()[dec_idx], float) self.assertIsInstance(f.attributes()[dec_idx], float)
self.assertEqual(f.attributes()[dec_idx], 1.123) self.assertEqual(f.attributes()[dec_idx], 1.123)


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Failing on Travis') @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Failing on Travis')
def testCreateLayer(self): def testCreateLayer(self):
layer = QgsVectorLayer("Point?field=id:integer&field=fldtxt:string&field=fldint:integer", layer = QgsVectorLayer("Point?field=id:integer&field=fldtxt:string&field=fldint:integer",
"addfeat", "memory") "addfeat", "memory")
Expand Down Expand Up @@ -326,7 +326,7 @@ def testCreateLayer(self):
geom = [f.geometry().asWkt() for f in new_layer.getFeatures()] geom = [f.geometry().asWkt() for f in new_layer.getFeatures()]
self.assertEqual(geom, ['Point (1 2)', '', 'Point (3 2)', 'Point (4 3)']) self.assertEqual(geom, ['Point (1 2)', '', 'Point (3 2)', 'Point (4 3)'])


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Failing on Travis') @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Failing on Travis')
def testCreateLayerMultiPoint(self): def testCreateLayerMultiPoint(self):
layer = QgsVectorLayer("MultiPoint?crs=epsg:3111&field=id:integer&field=fldtxt:string&field=fldint:integer", layer = QgsVectorLayer("MultiPoint?crs=epsg:3111&field=id:integer&field=fldtxt:string&field=fldint:integer",
"addfeat", "memory") "addfeat", "memory")
Expand Down Expand Up @@ -359,7 +359,7 @@ def testCreateLayerMultiPoint(self):
geom = [f.geometry().asWkt() for f in new_layer.getFeatures()] geom = [f.geometry().asWkt() for f in new_layer.getFeatures()]
self.assertEqual(geom, ['MultiPoint ((1 2),(3 4))', '', 'MultiPoint ((7 8))']) self.assertEqual(geom, ['MultiPoint ((1 2),(3 4))', '', 'MultiPoint ((7 8))'])


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Failing on Travis') @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Failing on Travis')
def testCurveGeometries(self): def testCurveGeometries(self):
geomtypes = ['CompoundCurveM', 'CurvePolygonM', 'CircularStringM', 'CompoundCurveZM', 'CurvePolygonZM', geomtypes = ['CompoundCurveM', 'CurvePolygonM', 'CircularStringM', 'CompoundCurveZM', 'CurvePolygonZM',
'CircularStringZM', 'CompoundCurveZ', 'CurvePolygonZ', 'CircularStringZ', 'CompoundCurve', 'CircularStringZM', 'CompoundCurveZ', 'CurvePolygonZ', 'CircularStringZ', 'CompoundCurve',
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_provider_postgres.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2384,7 +2384,7 @@ def testIdentityPk(self):
feature = next(vl.getFeatures()) feature = next(vl.getFeatures())
self.assertIsNotNone(feature.id()) self.assertIsNotNone(feature.id())


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Test flaky') @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Test flaky')
def testDefaultValuesAndClauses(self): def testDefaultValuesAndClauses(self):
"""Test whether default values like CURRENT_TIMESTAMP or """Test whether default values like CURRENT_TIMESTAMP or
now() they are respected. See GH #33383""" now() they are respected. See GH #33383"""
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgsactionmanager.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def check_action_result(self, temp_file):
return output return output


@unittest.expectedFailure(platform.system() != 'Linux') @unittest.expectedFailure(platform.system() != 'Linux')
@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Test is flaky on Travis environment') @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Test is flaky on Travis environment')
def testDoAction(self): def testDoAction(self):
""" test running action """ """ test running action """


Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgscoordinateoperationwidget.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def testOperations(self):
self.assertFalse(w.selectedOperation().allowFallback) self.assertFalse(w.selectedOperation().allowFallback)
self.assertEqual(len(spy), 8) self.assertEqual(len(spy), 8)


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true') or QgsProjUtils.projVersionMajor() >= 6, 'Depends on local environment and grid presence') @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true') or QgsProjUtils.projVersionMajor() >= 6, 'Depends on local environment and grid presence')
def testOperationsCruftyProj(self): def testOperationsCruftyProj(self):
w = QgsCoordinateOperationWidget() w = QgsCoordinateOperationWidget()
self.assertFalse(w.hasSelection()) self.assertFalse(w.hasSelection())
Expand Down
8 changes: 4 additions & 4 deletions tests/src/python/test_qgsfiledownloader.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _make_download(self, url, destination, cancel=False):


loop.exec_() loop.exec_()


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'),
'Test with http://www.qgis.org unstable. Needs local server.') 'Test with http://www.qgis.org unstable. Needs local server.')
def test_validDownload(self): def test_validDownload(self):
"""Tests a valid download""" """Tests a valid download"""
Expand All @@ -79,7 +79,7 @@ def test_inValidDownload(self):
self.assertEqual(self.error_args[1], [u'Download failed: Host www.doesnotexistofthatimsure.qgis not found']) self.assertEqual(self.error_args[1], [u'Download failed: Host www.doesnotexistofthatimsure.qgis not found'])
self.assertFalse(os.path.isfile(destination)) self.assertFalse(os.path.isfile(destination))


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'),
'Test with http://www.github.com unstable. Needs local server.') 'Test with http://www.github.com unstable. Needs local server.')
def test_dowloadCanceled(self): def test_dowloadCanceled(self):
"""Tests user canceled download""" """Tests user canceled download"""
Expand All @@ -101,7 +101,7 @@ def test_InvalidUrl(self):
self.assertFalse(os.path.isfile(destination)) self.assertFalse(os.path.isfile(destination))
self.assertEqual(self.error_args[1], [u"Download failed: Protocol \"xyz\" is unknown"]) self.assertEqual(self.error_args[1], [u"Download failed: Protocol \"xyz\" is unknown"])


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'),
'Test with http://www.github.com unstable. Needs local server.') 'Test with http://www.github.com unstable. Needs local server.')
def test_InvalidFile(self): def test_InvalidFile(self):
self._make_download('https://github.com/qgis/QGIS/archive/master.zip', "") self._make_download('https://github.com/qgis/QGIS/archive/master.zip', "")
Expand Down Expand Up @@ -134,7 +134,7 @@ def ssl_compare(self, name, url, error):
result = ';'.join(result) result = ';'.join(result)
self.assertTrue(result.startswith(error), msg + "expected:\n%s\nactual:\n%s\n" % (result, error)) self.assertTrue(result.startswith(error), msg + "expected:\n%s\nactual:\n%s\n" % (result, error))


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Test with badssl.com unstable. Needs local server.') @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Test with badssl.com unstable. Needs local server.')
def test_sslExpired(self): def test_sslExpired(self):
self.ssl_compare("expired", "https://expired.badssl.com/", "SSL Errors: ;The certificate has expired") self.ssl_compare("expired", "https://expired.badssl.com/", "SSL Errors: ;The certificate has expired")
self.ssl_compare("self-signed", "https://self-signed.badssl.com/", self.ssl_compare("self-signed", "https://self-signed.badssl.com/",
Expand Down
4 changes: 2 additions & 2 deletions tests/src/python/test_qgslabellinesettings.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


class TestQgsLabelLineSettings(unittest.TestCase): class TestQgsLabelLineSettings(unittest.TestCase):


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'),
'Python version too old for enum classes to work') 'Python version too old for enum classes to work')
def test_line_settings(self): def test_line_settings(self):
""" """
Expand Down Expand Up @@ -128,7 +128,7 @@ def test_line_settings(self):
self.assertTrue(pal_settings.lineSettings().overrunDistanceMapUnitScale().minScale, 1) self.assertTrue(pal_settings.lineSettings().overrunDistanceMapUnitScale().minScale, 1)
self.assertTrue(pal_settings.lineSettings().overrunDistanceMapUnitScale().maxScale, 2) self.assertTrue(pal_settings.lineSettings().overrunDistanceMapUnitScale().maxScale, 2)


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'),
'Python version too old for enum classes to work') 'Python version too old for enum classes to work')
def testUpdateDataDefinedProps(self): def testUpdateDataDefinedProps(self):
settings = QgsLabelLineSettings() settings = QgsLabelLineSettings()
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgsproviderconnection_postgres.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def test_foreign_table_csv(self):


self.assertNotEquals(conn.tables('public', QgsAbstractDatabaseProviderConnection.Foreign | QgsAbstractDatabaseProviderConnection.Aspatial), []) self.assertNotEquals(conn.tables('public', QgsAbstractDatabaseProviderConnection.Foreign | QgsAbstractDatabaseProviderConnection.Aspatial), [])


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Disabled on Travis') @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Disabled on Travis')
def test_foreign_table_server(self): def test_foreign_table_server(self):
"""Test foreign table with server""" """Test foreign table with server"""


Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgsqueryresultmodel.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def loop_exiter():


self.assertTrue(res.fetchedRowCount() > 0 and res.fetchedRowCount() < self.NUM_RECORDS) self.assertTrue(res.fetchedRowCount() > 0 and res.fetchedRowCount() < self.NUM_RECORDS)


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Local manual test: not for CI') @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Local manual test: not for CI')
def test_widget(self): def test_widget(self):
"""Manual local GUI test for the model""" """Manual local GUI test for the model"""


Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgsserver_wms_getfeatureinfo.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ def testGetFeatureInfoJsonUseIdAsLayerName(self):
'test_project_use_layer_ids.qgs', 'test_project_use_layer_ids.qgs',
normalizeJson=True) normalizeJson=True)


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'),
"This test cannot run in TRAVIS because it relies on cascading external services") "This test cannot run in TRAVIS because it relies on cascading external services")
def testGetFeatureInfoCascadingLayers(self): def testGetFeatureInfoCascadingLayers(self):
"""Test that we can get feature info on cascading WMS layers""" """Test that we can get feature info on cascading WMS layers"""
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgsserver_wms_getmap.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ def test_wms_getmap_datasource_error(self):


self.assertTrue('ServerException' in str(r)) self.assertTrue('ServerException' in str(r))


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'),
'Can\'t rely on external resources for continuous integration') 'Can\'t rely on external resources for continuous integration')
def test_wms_getmap_external(self): def test_wms_getmap_external(self):
# 1 bits # 1 bits
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgsserver_wms_getprint.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def test_wms_getprint_two_maps(self):
r, h = self._result(self._execute_request(qs)) r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetPrint_TwoMaps") self._img_diff_error(r, h, "WMS_GetPrint_TwoMaps")


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'),
'Can\'t rely on external resources for continuous integration') 'Can\'t rely on external resources for continuous integration')
def test_wms_getprint_external(self): def test_wms_getprint_external(self):
qs = "?" + "&".join(["%s=%s" % i for i in list({ qs = "?" + "&".join(["%s=%s" % i for i in list({
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgstaskmanager.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def finished_multiple_value_result(e, results):
self.assertEqual(result_value, 5) self.assertEqual(result_value, 5)
self.assertEqual(result_statement, 'whoo') self.assertEqual(result_statement, 'whoo')


@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true' or os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Test is unstable on Travis') @unittest.skipIf(os.environ.get('QGIS_CONTINUOUS_INTEGRATION_RUN', 'true'), 'Test is unstable on Travis')
def testTaskFromFunctionWithSubTaskCompletedIsCalledOnce(self): # spellok def testTaskFromFunctionWithSubTaskCompletedIsCalledOnce(self): # spellok
""" test that when a parent task has subtasks it does emit taskCompleted only once""" """ test that when a parent task has subtasks it does emit taskCompleted only once"""


Expand Down

0 comments on commit 18dd7d3

Please sign in to comment.