[CalendarServer-changes] [8023] CalendarServer/trunk/txdav/common/datastore/test

source_changes at macosforge.org source_changes at macosforge.org
Fri Aug 26 06:15:31 PDT 2011


Revision: 8023
          http://trac.macosforge.org/projects/calendarserver/changeset/8023
Author:   cdaboo at apple.com
Date:     2011-08-26 06:15:31 -0700 (Fri, 26 Aug 2011)
Log Message:
-----------
Fix tests.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/common/datastore/test/test_util.py

Added Paths:
-----------
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema1/upgrades/fake_dialect/
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema1/upgrades/fake_dialect/upgrade_from_3_to_4.sql
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_3_to_4.sql
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_3_to_5.sql
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_4_to_5.sql
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/fake_dialect/
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/fake_dialect/upgrade_from_3_to_4.sql
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/fake_dialect/upgrade_from_4_to_5.sql

Removed Paths:
-------------
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema1/upgrades/upgrade_from_3_to_4.sql
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_3_to_4.sql
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_3_to_5.sql
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_4_to_5.sql
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/upgrade_from_3_to_4.sql
    CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/upgrade_from_4_to_5.sql

Added: CalendarServer/trunk/txdav/common/datastore/test/fake_schema1/upgrades/fake_dialect/upgrade_from_3_to_4.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema1/upgrades/fake_dialect/upgrade_from_3_to_4.sql	                        (rev 0)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema1/upgrades/fake_dialect/upgrade_from_3_to_4.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -0,0 +1,24 @@
+----
+-- Copyright (c) 2011 Apple Inc. All rights reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+----
+
+-------------------------------------------------
+-- Upgrade database schema from VERSION 3 to 4 --
+-------------------------------------------------
+
+
+-- Now update the version
+update CALENDARSERVER set VALUE = '4' where NAME = 'VERSION';
+

Deleted: CalendarServer/trunk/txdav/common/datastore/test/fake_schema1/upgrades/upgrade_from_3_to_4.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema1/upgrades/upgrade_from_3_to_4.sql	2011-08-26 03:54:16 UTC (rev 8022)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema1/upgrades/upgrade_from_3_to_4.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -1,24 +0,0 @@
-----
--- Copyright (c) 2011 Apple Inc. All rights reserved.
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-----
-
--------------------------------------------------
--- Upgrade database schema from VERSION 3 to 4 --
--------------------------------------------------
-
-
--- Now update the version
-update CALENDARSERVER set VALUE = '4' where NAME = 'VERSION';
-

Copied: CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_3_to_4.sql (from rev 8012, CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_3_to_4.sql)
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_3_to_4.sql	                        (rev 0)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_3_to_4.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -0,0 +1,24 @@
+----
+-- Copyright (c) 2011 Apple Inc. All rights reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+----
+
+-------------------------------------------------
+-- Upgrade database schema from VERSION 3 to 4 --
+-------------------------------------------------
+
+
+-- Now update the version
+update CALENDARSERVER set VALUE = '4' where NAME = 'VERSION';
+

Copied: CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_3_to_5.sql (from rev 8012, CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_3_to_5.sql)
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_3_to_5.sql	                        (rev 0)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_3_to_5.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -0,0 +1,24 @@
+----
+-- Copyright (c) 2011 Apple Inc. All rights reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+----
+
+-------------------------------------------------
+-- Upgrade database schema from VERSION 3 to 5 --
+-------------------------------------------------
+
+
+-- Now update the version
+update CALENDARSERVER set VALUE = '5' where NAME = 'VERSION';
+

Copied: CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_4_to_5.sql (from rev 8012, CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_4_to_5.sql)
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_4_to_5.sql	                        (rev 0)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/fake_dialect/upgrade_from_4_to_5.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -0,0 +1,24 @@
+----
+-- Copyright (c) 2011 Apple Inc. All rights reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+----
+
+-------------------------------------------------
+-- Upgrade database schema from VERSION 4 to 5 --
+-------------------------------------------------
+
+
+-- Now update the version
+update CALENDARSERVER set VALUE = '5' where NAME = 'VERSION';
+

Deleted: CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_3_to_4.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_3_to_4.sql	2011-08-26 03:54:16 UTC (rev 8022)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_3_to_4.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -1,24 +0,0 @@
-----
--- Copyright (c) 2011 Apple Inc. All rights reserved.
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-----
-
--------------------------------------------------
--- Upgrade database schema from VERSION 3 to 4 --
--------------------------------------------------
-
-
--- Now update the version
-update CALENDARSERVER set VALUE = '4' where NAME = 'VERSION';
-

Deleted: CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_3_to_5.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_3_to_5.sql	2011-08-26 03:54:16 UTC (rev 8022)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_3_to_5.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -1,24 +0,0 @@
-----
--- Copyright (c) 2011 Apple Inc. All rights reserved.
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-----
-
--------------------------------------------------
--- Upgrade database schema from VERSION 3 to 5 --
--------------------------------------------------
-
-
--- Now update the version
-update CALENDARSERVER set VALUE = '5' where NAME = 'VERSION';
-

Deleted: CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_4_to_5.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_4_to_5.sql	2011-08-26 03:54:16 UTC (rev 8022)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema2/upgrades/upgrade_from_4_to_5.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -1,24 +0,0 @@
-----
--- Copyright (c) 2011 Apple Inc. All rights reserved.
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-----
-
--------------------------------------------------
--- Upgrade database schema from VERSION 4 to 5 --
--------------------------------------------------
-
-
--- Now update the version
-update CALENDARSERVER set VALUE = '5' where NAME = 'VERSION';
-

Copied: CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/fake_dialect/upgrade_from_3_to_4.sql (from rev 8012, CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/upgrade_from_3_to_4.sql)
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/fake_dialect/upgrade_from_3_to_4.sql	                        (rev 0)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/fake_dialect/upgrade_from_3_to_4.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -0,0 +1,24 @@
+----
+-- Copyright (c) 2011 Apple Inc. All rights reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+----
+
+-------------------------------------------------
+-- Upgrade database schema from VERSION 3 to 4 --
+-------------------------------------------------
+
+
+-- Now update the version
+update CALENDARSERVER set VALUE = '4' where NAME = 'VERSION';
+

Copied: CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/fake_dialect/upgrade_from_4_to_5.sql (from rev 8012, CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/upgrade_from_4_to_5.sql)
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/fake_dialect/upgrade_from_4_to_5.sql	                        (rev 0)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/fake_dialect/upgrade_from_4_to_5.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -0,0 +1,24 @@
+----
+-- Copyright (c) 2011 Apple Inc. All rights reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+----
+
+-------------------------------------------------
+-- Upgrade database schema from VERSION 4 to 5 --
+-------------------------------------------------
+
+
+-- Now update the version
+update CALENDARSERVER set VALUE = '5' where NAME = 'VERSION';
+

Deleted: CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/upgrade_from_3_to_4.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/upgrade_from_3_to_4.sql	2011-08-26 03:54:16 UTC (rev 8022)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/upgrade_from_3_to_4.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -1,24 +0,0 @@
-----
--- Copyright (c) 2011 Apple Inc. All rights reserved.
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-----
-
--------------------------------------------------
--- Upgrade database schema from VERSION 3 to 4 --
--------------------------------------------------
-
-
--- Now update the version
-update CALENDARSERVER set VALUE = '4' where NAME = 'VERSION';
-

Deleted: CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/upgrade_from_4_to_5.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/upgrade_from_4_to_5.sql	2011-08-26 03:54:16 UTC (rev 8022)
+++ CalendarServer/trunk/txdav/common/datastore/test/fake_schema3/upgrades/upgrade_from_4_to_5.sql	2011-08-26 13:15:31 UTC (rev 8023)
@@ -1,24 +0,0 @@
-----
--- Copyright (c) 2011 Apple Inc. All rights reserved.
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-----
-
--------------------------------------------------
--- Upgrade database schema from VERSION 4 to 5 --
--------------------------------------------------
-
-
--- Now update the version
-update CALENDARSERVER set VALUE = '5' where NAME = 'VERSION';
-

Modified: CalendarServer/trunk/txdav/common/datastore/test/test_util.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/test_util.py	2011-08-26 03:54:16 UTC (rev 8022)
+++ CalendarServer/trunk/txdav/common/datastore/test/test_util.py	2011-08-26 13:15:31 UTC (rev 8023)
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 ##
+from twext.enterprise.ienterprise import ORACLE_DIALECT, POSTGRES_DIALECT
 
 """
 Tests for L{txdav.common.datastore.util}.
@@ -236,18 +237,18 @@
         upgrader = UpgradeDatabaseSchemaService(None, None)
 
         upgrader.schemaLocation = getModule(__name__).filePath.sibling("fake_schema1")
-        files = upgrader.scanForUpgradeFiles()
+        files = upgrader.scanForUpgradeFiles("fake_dialect")
         self.assertEqual(files, 
-            [(3, 4, upgrader.schemaLocation.child("upgrades").child("upgrade_from_3_to_4.sql"))],
+            [(3, 4, upgrader.schemaLocation.child("upgrades").child("fake_dialect").child("upgrade_from_3_to_4.sql"))],
         )
 
         upgrader.schemaLocation = getModule(__name__).filePath.sibling("fake_schema2")
-        files = upgrader.scanForUpgradeFiles()
+        files = upgrader.scanForUpgradeFiles("fake_dialect")
         self.assertEqual(files, 
             [
-                (3, 4, upgrader.schemaLocation.child("upgrades").child("upgrade_from_3_to_4.sql")),
-                (3, 5, upgrader.schemaLocation.child("upgrades").child("upgrade_from_3_to_5.sql")),
-                (4, 5, upgrader.schemaLocation.child("upgrades").child("upgrade_from_4_to_5.sql")),
+                (3, 4, upgrader.schemaLocation.child("upgrades").child("fake_dialect").child("upgrade_from_3_to_4.sql")),
+                (3, 5, upgrader.schemaLocation.child("upgrades").child("fake_dialect").child("upgrade_from_3_to_5.sql")),
+                (4, 5, upgrader.schemaLocation.child("upgrades").child("fake_dialect").child("upgrade_from_4_to_5.sql")),
             ]
         )
 
@@ -256,31 +257,31 @@
         upgrader = UpgradeDatabaseSchemaService(None, None)
 
         upgrader.schemaLocation = getModule(__name__).filePath.sibling("fake_schema1")
-        files = upgrader.scanForUpgradeFiles()
-        upgrades = upgrader.determineUpgradeSequence(3, 4, files)
+        files = upgrader.scanForUpgradeFiles("fake_dialect")
+        upgrades = upgrader.determineUpgradeSequence(3, 4, files, "fake_dialect")
         self.assertEqual(upgrades, 
-            [upgrader.schemaLocation.child("upgrades").child("upgrade_from_3_to_4.sql")],
+            [upgrader.schemaLocation.child("upgrades").child("fake_dialect").child("upgrade_from_3_to_4.sql")],
         )
-        self.assertRaises(RuntimeError, upgrader.determineUpgradeSequence, 3, 5, files)
+        self.assertRaises(RuntimeError, upgrader.determineUpgradeSequence, 3, 5, files, "fake_dialect")
 
         upgrader.schemaLocation = getModule(__name__).filePath.sibling("fake_schema2")
-        files = upgrader.scanForUpgradeFiles()
-        upgrades = upgrader.determineUpgradeSequence(3, 5, files)
+        files = upgrader.scanForUpgradeFiles("fake_dialect")
+        upgrades = upgrader.determineUpgradeSequence(3, 5, files, "fake_dialect")
         self.assertEqual(upgrades, 
-            [upgrader.schemaLocation.child("upgrades").child("upgrade_from_3_to_5.sql")]
+            [upgrader.schemaLocation.child("upgrades").child("fake_dialect").child("upgrade_from_3_to_5.sql")]
         )
-        upgrades = upgrader.determineUpgradeSequence(4, 5, files)
+        upgrades = upgrader.determineUpgradeSequence(4, 5, files, "fake_dialect")
         self.assertEqual(upgrades, 
-            [upgrader.schemaLocation.child("upgrades").child("upgrade_from_4_to_5.sql")]
+            [upgrader.schemaLocation.child("upgrades").child("fake_dialect").child("upgrade_from_4_to_5.sql")]
         )
 
         upgrader.schemaLocation = getModule(__name__).filePath.sibling("fake_schema3")
-        files = upgrader.scanForUpgradeFiles()
-        upgrades = upgrader.determineUpgradeSequence(3, 5, files)
+        files = upgrader.scanForUpgradeFiles("fake_dialect")
+        upgrades = upgrader.determineUpgradeSequence(3, 5, files, "fake_dialect")
         self.assertEqual(upgrades, 
             [
-                upgrader.schemaLocation.child("upgrades").child("upgrade_from_3_to_4.sql"),
-                upgrader.schemaLocation.child("upgrades").child("upgrade_from_4_to_5.sql"),
+                upgrader.schemaLocation.child("upgrades").child("fake_dialect").child("upgrade_from_3_to_4.sql"),
+                upgrader.schemaLocation.child("upgrades").child("fake_dialect").child("upgrade_from_4_to_5.sql"),
             ]
         )
 
@@ -289,20 +290,21 @@
         Make sure that each old schema has a valid upgrade path to the current one.
         """
         
-        upgrader = UpgradeDatabaseSchemaService(None, None)
-        files = upgrader.scanForUpgradeFiles()
-        
-        def _getSchemaVersion(fp):
-            schema = fp.getContent()
-            found = re.search("insert into CALENDARSERVER values \('VERSION', '(\d)+'\);", schema)
-            if found is None:
-                self.fail("Could not determine schema version for: %s" % (fp,))
-            return int(found.group(1))
+        for dialect in (POSTGRES_DIALECT, ORACLE_DIALECT,):
+            upgrader = UpgradeDatabaseSchemaService(None, None)
+            files = upgrader.scanForUpgradeFiles(dialect)
             
+            def _getSchemaVersion(fp):
+                schema = fp.getContent()
+                found = re.search("insert into CALENDARSERVER values \('VERSION', '(\d)+'\);", schema)
+                if found is None:
+                    self.fail("Could not determine schema version for: %s" % (fp,))
+                return int(found.group(1))
+                
+                
+            current_version = _getSchemaVersion(upgrader.schemaLocation.child("current.sql"))
             
-        current_version = _getSchemaVersion(upgrader.schemaLocation.child("current.sql"))
-        
-        for child in upgrader.schemaLocation.child("old").globChildren("*.sql"):
-            old_version = _getSchemaVersion(child)
-            upgrades = upgrader.determineUpgradeSequence(old_version, current_version, files)
-            self.assertNotEqual(len(upgrades), 0)
+            for child in upgrader.schemaLocation.child("old").globChildren("*.sql"):
+                old_version = _getSchemaVersion(child)
+                upgrades = upgrader.determineUpgradeSequence(old_version, current_version, files, dialect)
+                self.assertNotEqual(len(upgrades), 0)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110826/194e2c93/attachment-0001.html>


More information about the calendarserver-changes mailing list