Skip to content
Permalink
Browse files

drop TRAVIS env variable

  • Loading branch information
3nids authored and nyalldawson committed Feb 8, 2021
1 parent edc7192 commit 18dd7d33f81578d04f0be71d9c8705ecc854a724
@@ -11,10 +11,8 @@ CTEST_BUILD_NAME
# Other var
QGIS_NO_OVERRIDE_IMPORT=1

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

LANG=C.UTF-8
LC_ALL=en_US.UTF-8
@@ -139,7 +139,7 @@ def testListLayer(self):

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
def testCreateRenameDeleteTable(self):
connection_name = 'testCreateRenameDeleteTable'
@@ -63,7 +63,7 @@ def setUpClass(cls):
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
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

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

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
super().testGetFeaturesUncompiled()

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
super().testGetFeaturesExp()

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
super().testOrderBy()

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
super().testOrderByCompiled()

@@ -290,7 +290,7 @@ def testFloatDecimalFields(self):
self.assertIsInstance(f.attributes()[dec_idx], float)
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):
layer = QgsVectorLayer("Point?field=id:integer&field=fldtxt:string&field=fldint:integer",
"addfeat", "memory")
@@ -326,7 +326,7 @@ def testCreateLayer(self):
geom = [f.geometry().asWkt() for f in new_layer.getFeatures()]
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):
layer = QgsVectorLayer("MultiPoint?crs=epsg:3111&field=id:integer&field=fldtxt:string&field=fldint:integer",
"addfeat", "memory")
@@ -359,7 +359,7 @@ def testCreateLayerMultiPoint(self):
geom = [f.geometry().asWkt() for f in new_layer.getFeatures()]
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):
geomtypes = ['CompoundCurveM', 'CurvePolygonM', 'CircularStringM', 'CompoundCurveZM', 'CurvePolygonZM',
'CircularStringZM', 'CompoundCurveZ', 'CurvePolygonZ', 'CircularStringZ', 'CompoundCurve',
@@ -2384,7 +2384,7 @@ def testIdentityPk(self):
feature = next(vl.getFeatures())
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):
"""Test whether default values like CURRENT_TIMESTAMP or
now() they are respected. See GH #33383"""
@@ -157,7 +157,7 @@ def check_action_result(self, temp_file):
return output

@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):
""" test running action """

@@ -116,7 +116,7 @@ def testOperations(self):
self.assertFalse(w.selectedOperation().allowFallback)
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):
w = QgsCoordinateOperationWidget()
self.assertFalse(w.hasSelection())
@@ -53,7 +53,7 @@ def _make_download(self, url, destination, cancel=False):

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.')
def test_validDownload(self):
"""Tests a valid download"""
@@ -79,7 +79,7 @@ def test_inValidDownload(self):
self.assertEqual(self.error_args[1], [u'Download failed: Host www.doesnotexistofthatimsure.qgis not found'])
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.')
def test_dowloadCanceled(self):
"""Tests user canceled download"""
@@ -101,7 +101,7 @@ def test_InvalidUrl(self):
self.assertFalse(os.path.isfile(destination))
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.')
def test_InvalidFile(self):
self._make_download('https://github.com/qgis/QGIS/archive/master.zip', "")
@@ -134,7 +134,7 @@ def ssl_compare(self, name, url, error):
result = ';'.join(result)
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):
self.ssl_compare("expired", "https://expired.badssl.com/", "SSL Errors: ;The certificate has expired")
self.ssl_compare("self-signed", "https://self-signed.badssl.com/",
@@ -30,7 +30,7 @@

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')
def test_line_settings(self):
"""
@@ -128,7 +128,7 @@ def test_line_settings(self):
self.assertTrue(pal_settings.lineSettings().overrunDistanceMapUnitScale().minScale, 1)
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')
def testUpdateDataDefinedProps(self):
settings = QgsLabelLineSettings()
@@ -293,7 +293,7 @@ def test_foreign_table_csv(self):

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):
"""Test foreign table with server"""

@@ -113,7 +113,7 @@ def loop_exiter():

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):
"""Manual local GUI test for the model"""

@@ -866,7 +866,7 @@ def testGetFeatureInfoJsonUseIdAsLayerName(self):
'test_project_use_layer_ids.qgs',
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")
def testGetFeatureInfoCascadingLayers(self):
"""Test that we can get feature info on cascading WMS layers"""
@@ -1635,7 +1635,7 @@ def test_wms_getmap_datasource_error(self):

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')
def test_wms_getmap_external(self):
# 1 bits
@@ -329,7 +329,7 @@ def test_wms_getprint_two_maps(self):
r, h = self._result(self._execute_request(qs))
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')
def test_wms_getprint_external(self):
qs = "?" + "&".join(["%s=%s" % i for i in list({
@@ -262,7 +262,7 @@ def finished_multiple_value_result(e, results):
self.assertEqual(result_value, 5)
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
""" test that when a parent task has subtasks it does emit taskCompleted only once"""

0 comments on commit 18dd7d3

Please sign in to comment.