Skip to content

Commit

Permalink
Tests now respect system.name again; int test force cleans at very be…
Browse files Browse the repository at this point in the history
…ginning
  • Loading branch information
Michael Meisinger committed Jul 14, 2012
1 parent ccc4e42 commit 59ccbf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 7 additions & 7 deletions pyon/core/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ def get_sys_name():
if sys_name:
return sys_name

# if CFG.get_safe("system.name"):
# # If CFG is already loaded and system.name is set use it
# cfg_sys_name = CFG.get_safe("system.name")
# set_sys_name(cfg_sys_name)
# return cfg_sys_name
# elif is_testing():
if is_testing():
if CFG.get_safe("system.name"):
# If CFG is already loaded and system.name is set use it
cfg_sys_name = CFG.get_safe("system.name")
set_sys_name(cfg_sys_name)
return cfg_sys_name
elif is_testing():
# if is_testing():
# If no sysname is specified and we are testing, create a unique one
testing_sys_name = "ion_test_%s" % str(uuid.uuid4())[0:6]
set_sys_name(testing_sys_name)
Expand Down
6 changes: 4 additions & 2 deletions pyon/util/int_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def initialize_ion_int_tests():
# Bootstrap pyon CFG, logging and object/resource interfaces
bootstrap_pyon()
if bootstrap.is_testing():
IonIntegrationTestCase._force_clean(False)
pre_initialize_ion()

initialize_ion_int_tests()


class IonIntegrationTestCase(unittest.TestCase):
Expand Down Expand Up @@ -128,7 +128,8 @@ def _patch_out_fail_fast_kill(self):
patcher.start()
self.addCleanup(patcher.stop)

def _force_clean(self, recreate=False):
@classmethod
def _force_clean(cls, recreate=False):
from pyon.core.bootstrap import get_sys_name, CFG
from pyon.datastore.couchdb.couchdb_standalone import CouchDataStore
datastore = CouchDataStore(config=CFG)
Expand All @@ -143,3 +144,4 @@ def _force_clean(self, recreate=False):
finally:
datastore.close()

initialize_ion_int_tests()

0 comments on commit 59ccbf8

Please sign in to comment.