Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#14246 closed (fixed)

aggregation_regress tests don't run on Postgres that supports StdDev

Reported by: kmtracey Owned by: nobody
Component: Uncategorized Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

Since being refactored unit tests (r13614/r13615), aggregation_regress tests fail on sufficiently high levels of Postgres:

Creating table aggregation_regress_hardbackbook
Installing custom SQL ...
Installing indexes ...
Installed 25 object(s) from 1 fixture(s)
test_aggrate_annotation (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_aggregate (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_aggregate_fexpr (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_aggregates_in_where_clause (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_aggregates_in_where_clause_pre_eval (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_annotate_with_extra (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_annotation (regressiontests.aggregation_regress.tests.AggregationTests) ... FAIL
test_db_col_table (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_empty (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_field_error (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_more (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_more_more (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_more_more_more (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_pickle (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_stddev (regressiontests.aggregation_regress.tests.AggregationTests) ... ERROR

======================================================================
ERROR: test_stddev (regressiontests.aggregation_regress.tests.AggregationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kmtracey/django/hgclone/tests/regressiontests/aggregation_regress/tests.py", line 625, in test_stddev
    Book.objects.aggregate(StdDev('pages')),
NameError: global name 'StdDev' is not defined

======================================================================
FAIL: test_annotation (regressiontests.aggregation_regress.tests.AggregationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kmtracey/django/hgclone/tests/regressiontests/aggregation_regress/tests.py", line 145, in test_annotation
    rating=3.0
  File "/home/kmtracey/django/hgclone/tests/regressiontests/aggregation_regress/tests.py", line 35, in assertObjectAttrs
    self.assertEqual(getattr(obj, attr), value)
AssertionError: Decimal('11.545') != 11.545

----------------------------------------------------------------------
Ran 15 tests in 0.342s

FAILED (failures=1, errors=1)
Destroying test database 'default'...
Destroying test database 'other'...

Partial fix attached, which imports StdDev and Variance and sprinkles Approximate as needed. It would be good if someone who understands how Approximate is supposed to be used took a look, since it's not immediately obvious to me...the values supplied for places here are sometimes smaller than I would have thought they should be, but they are what is needed to get the tests to pass on my machine.

Also still needed is understanding of the test_annotation failure.

Attachments (1)

aggregation_regress.diff (3.2 KB) - added by kmtracey 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by kmtracey

comment:1 Changed 5 years ago by kmtracey

(In [13710]) [1.2.X] Fixed some of the problems with aggregation_regress tests on higher levles of Postgres. Refs #14246.

r13709 from trunk.

comment:2 Changed 5 years ago by kmtracey

  • Resolution set to fixed
  • Status changed from new to closed

(In [13712]) Fixed #14246: Modified aggregation_regress tests so that they will pass on a variety (sqlite, Postgres, MySQL/MyISAM) of DBs.

comment:3 Changed 5 years ago by kmtracey

(In [13714]) [1.2.X] Fixed #14246: Modified aggregation_regress tests so that they will pass on a variety (sqlite, Postgres, MySQL/MyISAM) of DBs.

r13712 from trunk.

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