← Back to team overview

divmod-dev team mailing list archive

lp:~divmod-dev/divmod.org/1209082-remove-bogus-performance-tests into lp:divmod.org

 

Tristan Seligmann has proposed merging lp:~divmod-dev/divmod.org/1209082-remove-bogus-performance-tests into lp:divmod.org.

Requested reviews:
  Divmod-dev (divmod-dev)
Related bugs:
  Bug #1209082 in Divmod: "Bogus performance tests"
  https://bugs.launchpad.net/divmod.org/+bug/1209082

For more details, see:
https://code.launchpad.net/~divmod-dev/divmod.org/1209082-remove-bogus-performance-tests/+merge/178882


-- 
https://code.launchpad.net/~divmod-dev/divmod.org/1209082-remove-bogus-performance-tests/+merge/178882
Your team Divmod-dev is requested to review the proposed merge of lp:~divmod-dev/divmod.org/1209082-remove-bogus-performance-tests into lp:divmod.org.
=== modified file 'Axiom/axiom/test/test_query.py'
--- Axiom/axiom/test/test_query.py	2009-01-01 00:28:15 +0000
+++ Axiom/axiom/test/test_query.py	2013-08-07 05:25:33 +0000
@@ -1,12 +1,11 @@
 
 import operator, random
 
-from twisted.trial.unittest import TestCase, SkipTest
+from twisted.trial.unittest import TestCase
 
 from axiom.iaxiom import IComparison, IColumn
 from axiom.store import Store, ItemQuery, MultipleItemQuery
 from axiom.item import Item, Placeholder
-from axiom.test.util import QueryCounter
 
 from axiom import errors
 from axiom.attributes import (
@@ -309,9 +308,9 @@
             self.assertEquals(s.query(E).count(), 0)
             self.assertEquals(s.query(E).getColumn("amount").sum(), 0)
 
-            e1 = E(store=s, name=u'widgets', amount=37)
-            e2 = E(store=s, name=u'widgets', amount=63)
-            e3 = E(store=s, name=u'quatloos', amount=99, transaction=u'yes')
+            E(store=s, name=u'widgets', amount=37)
+            E(store=s, name=u'widgets', amount=63)
+            E(store=s, name=u'quatloos', amount=99, transaction=u'yes')
             s.checkpoint()
             q = s.count(E, E.name == u'widgets')
             self.failUnlessEqual(q, 2)
@@ -663,8 +662,8 @@
             for i in range(3):
                 c = C(store=s, name=u"C.%s" % i)
                 b = B(store=s, name=u"B.%s" % i, cref=c)
-                a = A(store=s, type=u"A.%s" % i, reftoc=b)
-                a = A(store=s, type=u"A.%s" % i, reftoc=b)
+                A(store=s, type=u"A.%s" % i, reftoc=b)
+                A(store=s, type=u"A.%s" % i, reftoc=b)
 
             query = s.query( (B, C),
                              AND(B.cref == C.storeID,
@@ -693,8 +692,8 @@
         def entesten():
             pops = B(store=s, name=u"Pops")
             dad = B(store=s, name=u"Dad", cref=pops)
-            bro = B(store=s, name=u"Bro", cref=dad)
-            sis = B(store=s, name=u"Sis", cref=dad)
+            B(store=s, name=u"Bro", cref=dad)
+            B(store=s, name=u"Sis", cref=dad)
 
             Gen1 = Placeholder(B)
             Gen2 = Placeholder(B)
@@ -1019,72 +1018,6 @@
              store.getTableName(A)])
 
 
-class FirstType(Item):
-    value = text()
-
-
-class SecondType(Item):
-    value = text()
-    ref = reference(reftype=FirstType)
-
-
-class QueryComplexity(TestCase):
-    comparison = AND(FirstType.value == u"foo",
-                     SecondType.ref == FirstType.storeID,
-                     SecondType.value == u"bar")
-
-    def setUp(self):
-        self.store = Store()
-        self.query = self.store.query(FirstType, self.comparison)
-
-        # Make one of each to get any initialization taken care of so it
-        # doesn't pollute our numbers below.
-        FirstType(store=self.store)
-        SecondType(store=self.store)
-
-
-    def test_firstTableOuterLoop(self):
-        """
-        Test that in a two table query, the table which appears first in the
-        result of the getInvolvedTables method of the comparison used is the
-        one which the outer join loop iterates over.
-
-        Test this by inserting rows into the first table and checking that the
-        number of bytecodes executed increased.
-        """
-        counter = QueryCounter(self.store)
-        counts = []
-        for c in range(10):
-            counts.append(counter.measure(list, self.query))
-            FirstType(store=self.store)
-
-        # Make sure they're not all the same
-        self.assertEqual(len(set(counts)), len(counts))
-
-        # Make sure they're increasing
-        self.assertEqual(counts, sorted(counts))
-
-
-    def test_secondTableInnerLoop(self):
-        """
-        Like L{test_firstTableOuterLoop} but for the second table being
-        iterated over by the inner loop.
-
-        This creates more rows in the second table while still performing a
-        query for which no rows in the first table satisfy the WHERE
-        condition.  This should mean that rows from the second table are
-        never examined.
-        """
-        counter = QueryCounter(self.store)
-        count = None
-        for i in range(10):
-            c = counter.measure(list, self.query)
-            if count is None:
-                count = c
-            self.assertEqual(count, c)
-            SecondType(store=self.store)
-
-
 class AndOrQueries(QueryingTestCase):
     def testNoConditions(self):
         self.assertRaises(ValueError, AND)
@@ -1230,7 +1163,7 @@
 
     def testOneOfWithList(self):
         cx = C(store=self.store, name=u'x')
-        cy = C(store=self.store, name=u'y')
+        C(store=self.store, name=u'y')
         cz = C(store=self.store, name=u'z')
 
         query = self.store.query(
@@ -1243,7 +1176,7 @@
         s = Store()
 
         cx = C(store=s, name=u'x')
-        cy = C(store=s, name=u'y')
+        C(store=s, name=u'y')
         cz = C(store=s, name=u'z')
 
         self.assertEquals(list(s.query(C, C.name.oneOf(set([u'x', u'z', u'a'])), sort=C.name.ascending)),
@@ -1433,7 +1366,6 @@
         """
         Test that a column from a placeholder provides L{IColumn}.
         """
-        value = 0
         p = Placeholder(PlaceholderTestItem)
         a = p.attr
         self.failUnless(IColumn.providedBy(a))
@@ -1458,7 +1390,6 @@
         underlying Item class and comparing it to another column returns an
         L{IComparison} provider.
         """
-        value = 0
         p = Placeholder(PlaceholderTestItem)
         for op in COMPARISON_OPS:
             self.failUnless(IComparison.providedBy(op(p.attr, PlaceholderTestItem.attr)))


Follow ups