@@ -67,10 +67,12 @@ def init_repo(self):
6767 # if this happens its fine .. just means the repo is already there
6868 pass
6969
70+
7071 def run (self ):
7172 here = os .getcwd ()
7273 os .chdir (self .testr_directory )
73- self ._ui .c = (self .testr_directory + 'tempest.conf' )
74+ self ._ui .c = self .testr_directory + 'tempest.conf'
75+
7476 cmd = run .run (self ._ui )
7577 try :
7678 res = cmd .execute ()
@@ -88,7 +90,7 @@ def testrepository_last_stream(self):
8890
8991
9092
91- class Test (object ):
93+ class Tester (object ):
9294 """ Test functions"""
9395 test_id = None
9496 sha = None
@@ -108,6 +110,7 @@ def __init__(self,cloud_id=None,test_id=None,sha=None):
108110 self .tempest_config = TempestConfig (cloud_id )
109111 self .cloud_id = cloud_id
110112 self .sha = sha
113+ self .test_path = "/tmp/%s" % self .cloud_id
111114
112115
113116 def run_remote (self ):
@@ -118,13 +121,25 @@ def run_remote(self):
118121
119122
120123 def run_local ():
121- """ triggers local run"""
122- # generates config
124+ """triggers local run"""
125+ # make sure we have a folder to put a repo in..
126+ if not os .path .exists (self .test_path ):
127+ os .makedirs (self .test_path )
128+
129+ # write the tempest config to that folder
130+ self .write_config (self .test_path )
131+
132+ # setup the repo wrapper.. this creates the repo if its not already there
133+ tr = TestRepositorySource (self .test_path )
134+
135+ # run tests
136+ tr .run ()
123137
124- # write to disk (this should cleanly invoke tempest with this config instead and then )
125- self . tr = TestRepositorySource ( '/tmp/' )
138+ # get back the results
139+ result = tr . testrepository_last_stream ( )
126140
127- return "run_local called"
141+ # write results to database maybe .. or return them .. not sure which ..
142+ return result .read ()
128143
129144
130145 def write_config (self , path ):
0 commit comments