Commit 3580deae by Ned Batchelder

Merge pull request #1534 from MITx/fix/zoldak/test-modulestore-naming

Change test modulestore naming differentiation scheme to uuid
parents 49cab68a 9eb27669
import json import json
import copy import copy
from time import time from uuid import uuid4
from django.test import TestCase from django.test import TestCase
from django.conf import settings from django.conf import settings
...@@ -20,13 +20,12 @@ class ModuleStoreTestCase(TestCase): ...@@ -20,13 +20,12 @@ class ModuleStoreTestCase(TestCase):
def _pre_setup(self): def _pre_setup(self):
super(ModuleStoreTestCase, self)._pre_setup() super(ModuleStoreTestCase, self)._pre_setup()
# Use the current seconds since epoch to differentiate # Use a uuid to differentiate
# the mongo collections on jenkins. # the mongo collections on jenkins.
sec_since_epoch = '%s' % int(time() * 100)
self.orig_MODULESTORE = copy.deepcopy(settings.MODULESTORE) self.orig_MODULESTORE = copy.deepcopy(settings.MODULESTORE)
self.test_MODULESTORE = self.orig_MODULESTORE self.test_MODULESTORE = self.orig_MODULESTORE
self.test_MODULESTORE['default']['OPTIONS']['collection'] = 'modulestore_%s' % sec_since_epoch self.test_MODULESTORE['default']['OPTIONS']['collection'] = 'modulestore_%s' % uuid4().hex
self.test_MODULESTORE['direct']['OPTIONS']['collection'] = 'modulestore_%s' % sec_since_epoch self.test_MODULESTORE['direct']['OPTIONS']['collection'] = 'modulestore_%s' % uuid4().hex
settings.MODULESTORE = self.test_MODULESTORE settings.MODULESTORE = self.test_MODULESTORE
# Flush and initialize the module store # Flush and initialize the module store
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment