Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#23504 closed Bug (fixed)

Oracle GIS test failures

Reported by: Tim Graham Owned by: Tim Graham
Component: GIS Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As we haven't had this build on Jenkins for a while (ever?), there are quite a few test failures that need fixing.

Change History (23)

comment:1 by Tim Graham, 10 years ago

Below are the failures from 89559bcfb096ccc625e0e9ab41e2136fcb32a514 (right before e9103402c0fa873aea58a6a11dba510cd308cb84#diff-54b46d05e1da568b3cc987c423e00c50L253 which broke a bunch more with errors like:

======================================================================
ERROR [0.001s]: test02_select_related (django.contrib.gis.tests.relatedapp.tests.RelatedGeoModelTest)
Testing `select_related` on geographic models (see #7126).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jenkins/workspace/django-oracle/database/oragis11/python/python2.7/django/contrib/gis/tests/relatedapp/tests.py", line 40, in test02_select_related
    self.assertEqual(Point(lon, lat), c.location.point)
  File "/home/jenkins/workspace/django-oracle/database/oragis11/python/python2.7/django/db/models/fields/related.py", line 565, in __get__
    rel_obj = qs.get()
  File "/home/jenkins/workspace/django-oracle/database/oragis11/python/python2.7/django/db/models/query.py", line 363, in get
    num = len(clone)
  File "/home/jenkins/workspace/django-oracle/database/oragis11/python/python2.7/django/db/models/query.py", line 143, in __len__
    self._fetch_all()
  File "/home/jenkins/workspace/django-oracle/database/oragis11/python/python2.7/django/db/models/query.py", line 977, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/home/jenkins/workspace/django-oracle/database/oragis11/python/python2.7/django/db/models/query.py", line 287, in iterator
    for row in compiler.results_iter():
  File "/home/jenkins/workspace/django-oracle/database/oragis11/python/python2.7/django/db/models/sql/compiler.py", line 764, in results_iter
    row = self.apply_converters(row, converters)
  File "/home/jenkins/workspace/django-oracle/database/oragis11/python/python2.7/django/db/models/sql/compiler.py", line 711, in apply_converters
    value = converter(value, self.connection)
  File "/home/jenkins/workspace/django-oracle/database/oragis11/python/python2.7/django/contrib/gis/db/models/fields.py", line 202, in from_db_value
    value = Geometry(value)
  File "/home/jenkins/workspace/django-oracle/database/oragis11/python/python2.7/django/contrib/gis/geos/geometry.py", line 89, in __init__
    raise TypeError('Improper geometry input type: %s' % str(type(geo_input)))
TypeError: Improper geometry input type: <type 'cx_Oracle.LOB'>

I guess it's because this logic was lost https://github.com/django/django/commit/e9103402c0fa873aea58a6a11dba510cd308cb84#diff-54b46d05e1da568b3cc987c423e00c50L253 on GIS fields.

======================================================================
ERROR: test13c_count (django.contrib.gis.tests.relatedapp.tests.RelatedGeoModelTest)
Testing `Count` aggregate with `.values()`.  See #15305.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/relatedapp/tests.py", line 255, in test13c_count
    self.assertEqual(1, len(qs))
  File "/home/tim/code/django/django/db/models/query.py", line 143, in __len__
    self._fetch_all()
  File "/home/tim/code/django/django/db/models/query.py", line 977, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/home/tim/code/django/django/db/models/query.py", line 1091, in iterator
    for row in self.query.get_compiler(self.db).results_iter():
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 700, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 786, in execute_sql
    cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/oracle/base.py", line 895, in execute
    return self.cursor.execute(query, self._param_generator(params))
DatabaseError: ORA-22901: cannot compare VARRAY or LOB attributes of an object type


======================================================================
ERROR: test_time_field (django.contrib.gis.tests.inspectapp.tests.OGRInspectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/inspectapp/tests.py", line 83, in test_time_field
    ogr_db = get_ogr_db_string()
  File "/home/tim/code/django/django/contrib/gis/tests/inspectapp/tests.py", line 142, in get_ogr_db_string
    drv_name, db_str, param_sep = drivers.get(db['ENGINE'])
TypeError: 'NoneType' object is not iterable

======================================================================
ERROR: test_textfield (django.contrib.gis.tests.layermap.tests.LayerMapTest)
Tests that String content fits also in a TextField
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/layermap/tests.py", line 297, in test_textfield
    self.assertEqual(City.objects.all().order_by('name_txt')[0].name_txt, "Houston")
  File "/home/tim/code/django/django/db/models/query.py", line 198, in __getitem__
    return list(qs)[0]
  File "/home/tim/code/django/django/db/models/query.py", line 162, in __iter__
    self._fetch_all()
  File "/home/tim/code/django/django/db/models/query.py", line 977, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/home/tim/code/django/django/db/models/query.py", line 287, in iterator
    for row in compiler.results_iter():
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 700, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 786, in execute_sql
    cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/oracle/base.py", line 895, in execute
    return self.cursor.execute(query, self._param_generator(params))
DatabaseError: ORA-00932: inconsistent datatypes: expected - got NCLOB


======================================================================
ERROR: test_raw_sql_query (django.contrib.gis.tests.geoapp.tests.GeoModelTest)
Testing raw SQL query.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/geoapp/tests.py", line 199, in test_raw_sql_query
    self.assertEqual(len(cities1), len(list(cities2)))
  File "/home/tim/code/django/django/db/models/query.py", line 1565, in __iter__
    query = iter(self.query)
  File "/home/tim/code/django/django/db/models/sql/query.py", line 76, in __iter__
    self._execute_query()
  File "/home/tim/code/django/django/db/models/sql/query.py", line 94, in _execute_query
    self.cursor.execute(self.sql, self.params)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/oracle/base.py", line 895, in execute
    return self.cursor.execute(query, self._param_generator(params))
DatabaseError: ORA-06553: PLS-306: wrong number or types of arguments in call to 'OGC_ASTEXT'


======================================================================
ERROR: test_defer_or_only_with_annotate (django.contrib.gis.tests.geoapp.test_regress.GeoRegressionTests)
Regression for #16409. Make sure defer() and only() work with annotate()
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/geoapp/test_regress.py", line 70, in test_defer_or_only_with_annotate
    self.assertIsInstance(list(City.objects.annotate(Count('point')).defer('name')), list)
  File "/home/tim/code/django/django/db/models/query.py", line 162, in __iter__
    self._fetch_all()
  File "/home/tim/code/django/django/db/models/query.py", line 977, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/home/tim/code/django/django/db/models/query.py", line 287, in iterator
    for row in compiler.results_iter():
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 700, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/home/tim/code/django/django/db/models/sql/compiler.py", line 786, in execute_sql
    cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/oracle/base.py", line 895, in execute
    return self.cursor.execute(query, self._param_generator(params))
DatabaseError: ORA-22901: cannot compare VARRAY or LOB attributes of an object type


======================================================================
ERROR: test_remove_gis_field (django.contrib.gis.tests.gis_migrations.test_operations.OperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/gis_migrations/test_operations.py", line 81, in test_remove_gis_field
    project_state = self.set_up_test_model()
  File "/home/tim/code/django/django/contrib/gis/tests/gis_migrations/test_operations.py", line 51, in set_up_test_model
    return self.apply_operations('gis', ProjectState(), operations)
  File "/home/tim/code/django/django/contrib/gis/tests/gis_migrations/test_operations.py", line 40, in apply_operations
    return migration.apply(project_state, editor)
  File "/home/tim/code/django/django/db/migrations/migration.py", line 107, in apply
    operation.database_forwards(self.app_label, schema_editor, project_state, new_state)
  File "/home/tim/code/django/django/db/migrations/operations/models.py", line 36, in database_forwards
    schema_editor.create_model(model)
  File "/home/tim/code/django/django/db/backends/schema.py", line 270, in create_model
    self.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/schema.py", line 98, in execute
    cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/oracle/base.py", line 895, in execute
    return self.cursor.execute(query, self._param_generator(params))
DatabaseError: ORA-00955: name is already used by an existing object


======================================================================
ERROR: test_add_entry (django.contrib.gis.tests.test_spatialrefsys.SpatialRefSysTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/test_spatialrefsys.py", line 110, in test_add_entry
    add_srs_entry(3857)
  File "/home/tim/code/django/django/contrib/gis/utils/srs.py", line 43, in add_srs_entry
    raise Exception('This utility does not support the '
Exception: This utility does not support the Oracle or MySQL spatial backends.

======================================================================
FAIL: test10_combine (django.contrib.gis.tests.relatedapp.tests.RelatedGeoModelTest)
Testing the combination of two GeoQuerySets.  See #10807.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/relatedapp/tests.py", line 214, in test10_combine
    self.assertEqual(2, len(names))
AssertionError: 2 != 1

======================================================================
FAIL: test_geom_columns (django.contrib.gis.tests.inspectapp.tests.InspectDbTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/inspectapp/tests.py", line 33, in test_geom_columns
    self.assertIn('geom = models.PolygonField()', output)
AssertionError: u'geom = models.PolygonField()' not found in "# This is an auto-generated Django model module.\n# You'll have to do the following manually to clean this up:\n#   * Rearrange models' order\n#   * Make sure each model has one field with primary_key=True\n#   * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table\n# Feel free to rename the models, but don't rename db_table values or field names.\n#\n# Also note: You'll have to insert the output of 'django-admin sqlcustom [app_label]'\n# into your database.\nfrom __future__ import unicode_literals\n\nfrom django.contrib.gis.db import models\n\n\nclass InspectappAllogrfields(models.Model):\n    id = models.IntegerField(primary_key=True)  # AutoField?\n    f_decimal = models.FloatField()\n    f_float = models.FloatField()\n    f_int = models.IntegerField()\n    f_char = models.CharField(max_length=20, blank=True)\n    f_date = models.DateField()\n    f_datetime = models.DateTimeField()\n    f_time = models.DateTimeField()\n    geom = models.GeometryField(blank=True, null=True)\n    point = models.GeometryField(blank=True, null=True)\n    objects = models.GeoManager()\n\n    class Meta:\n        managed = False\n        db_table = 'inspectapp_allogrfields'\n"

======================================================================
FAIL: test06_geography_area (django.contrib.gis.tests.geogapp.tests.GeographyTest)
Testing that Area calculations work on geography columns.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/test/testcases.py", line 968, in skip_wrapper
    return test_func(*args, **kwargs)
  File "/home/tim/code/django/django/contrib/gis/tests/geogapp/tests.py", line 102, in test06_geography_area
    self.assertAlmostEqual(z.area.sq_m, ref_area, tol)
AssertionError: 5439100.95415646 != 5439084.70637573 within 5 places

======================================================================
FAIL: test_unionagg (django.contrib.gis.tests.geoapp.tests.GeoQuerySetTest)
Testing the `unionagg` (aggregate union) GeoQuerySet method.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/test/testcases.py", line 968, in skip_wrapper
    return test_func(*args, **kwargs)
  File "/home/tim/code/django/django/contrib/gis/tests/geoapp/tests.py", line 751, in test_unionagg
    self.assertEqual(True, union1.equals_exact(u1, tol) or union2.equals_exact(u1, tol))
AssertionError: True != False

======================================================================
FAIL: test_add_gis_field (django.contrib.gis.tests.gis_migrations.test_operations.OperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/gis_migrations/test_operations.py", line 73, in test_add_gis_field
    2
AssertionError: 0 != 2

comment:2 by Tim Graham <timograham@…>, 10 years ago

In 7fce7f51eff58b86b97cb797546da57096c0a786:

Skipped some broken tests on Oracle GIS; refs #23504.

comment:3 by Tim Graham <timograham@…>, 10 years ago

In d8ee13789b93c8edcf13bf1b20ab9e0098eb81bd:

Avoided a crash on an Oracle GIS test; refs #23504.

comment:4 by Tim Graham <timograham@…>, 10 years ago

In 6c1a0581abd9cf21fa37c6c9e9937986da45005c:

Added a feature flag for add_srs_entry support; refs #22632 and #23504.

comment:5 by Tim Graham <timograham@…>, 10 years ago

In 33e817a6d8b163aa6e8a2fb15d7269d1ecbbcf59:

Added feature flag for geometry_field_introspection; refs #22632 and #23504.

comment:6 by Tim Graham <timograham@…>, 10 years ago

In 8facb02faf1880187888b26724760865547b05b0:

Improved GIS migration test cleanup; refs #23504.

comment:7 by Tim Graham <timograham@…>, 10 years ago

In 7fc13178d6b0e4b365c43991a6661c6b2118a3a9:

Removed unnecessary order_by() from a GIS test that crashed Oracle.

Oracle cannot order_by() a TextField; refs #23504.

comment:8 by Tim Graham <timograham@…>, 10 years ago

In c61d2c0387aeeaf5600b85c08b0d01b10655155c:

[1.7.x] Improved GIS migration test cleanup; refs #23504.

Backport of 8facb02faf from master

comment:9 by Tim Graham <timograham@…>, 10 years ago

In a0a65b2fd21d3f09997ff1701cb44e32d6eb0f59:

[1.7.x] Skipped some broken tests on Oracle GIS; refs #23504.

Backport of 7fce7f51ef from master

comment:10 by Tim Graham <timograham@…>, 10 years ago

In e295b0f8757db9bca72c21c15e7db6003a96393d:

[1.7.x] Removed unnecessary order_by() from a GIS test that crashed Oracle.

Oracle cannot order_by() a TextField; refs #23504.

Backport of 7fc13178d6 from master

comment:11 by Tim Graham <timograham@…>, 10 years ago

In 828edc5ba91e124392417c5a87c17647dbb1cf67:

Skipped a broken GIS test on Oracle; refs #23504.

comment:12 by Tim Graham <timograham@…>, 10 years ago

In 17a4038cf3aad025c653342eb18882c38dbdb1a9:

[1.7.x] Skipped a broken GIS test on Oracle; refs #23504.

Backport of 828edc5ba9 from master

comment:13 by Tim Graham <timograham@…>, 10 years ago

In 59d369db7854b55f22ff75da92971dcd0ab4322f:

[1.6.x] Skipped some broken tests on Oracle GIS; refs #23504.

Backport of 7fce7f51ef from master

comment:14 by Tim Graham <timograham@…>, 10 years ago

In 8cee5875a65d6b736c3cbafa774abdc62336ed08:

[1.6.x] Removed unnecessary order_by() from a GIS test that crashed Oracle.

Oracle cannot order_by() a TextField; refs #23504.

Backport of 7fc13178d6 from master

comment:15 by Tim Graham <timograham@…>, 10 years ago

In 2376319ce089cb3d5484fc1d9861f81a80d6abc4:

[1.6.x] Skipped a broken GIS test on Oracle; refs #23504.

Backport of 828edc5ba9 from master

comment:16 by Tim Graham, 10 years ago

The remaining failures are:

  1. Claude suggested trying a zip with a smaller area, but there are still discrepancies between what Oracle and the other DBs calculate.
======================================================================
FAIL: test06_geography_area (django.contrib.gis.tests.geogapp.tests.GeographyTest)
Testing that Area calculations work on geography columns.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/test/testcases.py", line 968, in skip_wrapper
    return test_func(*args, **kwargs)
  File "/home/tim/code/django/django/contrib/gis/tests/geogapp/tests.py", line 102, in test06_geography_area
    self.assertAlmostEqual(z.area.sq_m, ref_area, tol)
AssertionError: 5439100.95415646 != 5439084.70637573 within 5 places
  1. Can be made to pass with the diff the follows, but may more investigation and/or just skipped on Oracle.
======================================================================
FAIL: test_unionagg (django.contrib.gis.tests.geoapp.tests.GeoQuerySetTest)
Testing the `unionagg` (aggregate union) GeoQuerySet method.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/test/testcases.py", line 968, in skip_wrapper
    return test_func(*args, **kwargs)
  File "/home/tim/code/django/django/contrib/gis/tests/geoapp/tests.py", line 751, in test_unionagg
    self.assertEqual(True, union1.equals_exact(u1, tol) or union2.equals_exact(u1, tol))
AssertionError: True != False
diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py
index f4699ae..306664b 100644
--- a/django/contrib/gis/tests/geoapp/tests.py
+++ b/django/contrib/gis/tests/geoapp/tests.py
@@ -791,6 +791,8 @@ class GeoQuerySetTest(TestCase):
         # Houston, Dallas -- Ordering may differ depending on backend or GEOS version.
         union1 = fromstr('MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)')
         union2 = fromstr('MULTIPOINT(-95.363151 29.763374,-96.801611 32.782057)')
+        if oracle:
+            union1 = union2 = fromstr('POINT (-97.5211570000000023 34.4646419999999978)')
         qs = City.objects.filter(point__within=tx)
         self.assertRaises(TypeError, qs.unionagg, 'name')
         # Using `field_name` keyword argument in one query and specifying an
  1. Fixed in #23537.
======================================================================
FAIL: test_add_gis_field (django.contrib.gis.tests.gis_migrations.test_operations.OperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/contrib/gis/tests/gis_migrations/test_operations.py", line 73, in test_add_gis_field
    2
AssertionError: 0 != 2
Version 0, edited 10 years ago by Tim Graham (next)

comment:17 by Claude Paroz, 10 years ago

For 1., I think we will not avoid using a specific value for Oracle.
For 2., unless we understand what's happening, it should be marked as an expectedFailure on Oracle. Some Oracle lover will hopefully chime in and fix it.

comment:18 by Tim Graham <timograham@…>, 10 years ago

In 729cd6a11a6f14b56bfc2551834b4e0892142b12:

Skipped a broken geoapp test on Oracle; refs #23504.

comment:19 by Tim Graham <timograham@…>, 10 years ago

In b4c99203528b176fe3ebcf38002ef2c2ea723a7a:

[1.7.x] Skipped a broken geoapp test on Oracle; refs #23504.

Backport of 729cd6a11a from master

comment:20 by Tim Graham <timograham@…>, 10 years ago

In 943716c8ee601f4c12b5e0dc4a04e85c9dbe244b:

[1.6.x] Skipped a broken geoapp test on Oracle; refs #23504.

Backport of 729cd6a11a from master

comment:21 by Tim Graham <timograham@…>, 10 years ago

In a1709220d527385378e128949da4140709758d00:

Added an Oracle workaround for a geogapp test; refs #23504.

comment:22 by Tim Graham, 10 years ago

Resolution: fixed
Status: newclosed

Oracle GIS tests are passing and have been added to Jenkins.

comment:23 by Tim Graham <timograham@…>, 7 years ago

In fb3716b:

Enabled GeoQuerySetTest.test_unionagg on Oracle; refs #23504.

It's not clear when it started to work.

Note: See TracTickets for help on using tickets.
Back to Top