Merge lp:~spiv/bzr-usertest/server-start-stop into lp:~bzr/bzr-usertest/trunk-old

Proposed by Andrew Bennetts
Status: Merged
Merged at revision: not available
Proposed branch: lp:~spiv/bzr-usertest/server-start-stop
Merge into: lp:~bzr/bzr-usertest/trunk-old
To merge this branch: bzr merge lp:~spiv/bzr-usertest/server-start-stop
Reviewer Review Type Date Requested Status
Ian Clatworthy Needs Fixing
Martin Pool (community) none Approve
Review via email: mp+1321@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Andrew Bennetts (spiv) wrote :

This is fairly simple. It adds a couple more config variables, server_start_cmd and server_stop_cmd, and runs them at the appropriate time.

I've been using server_start_cmd to point to a shell script that: makes an empty directory, runs "bzr serve --allow-writes" in it, and then waits for bzr serve to actually be listening, then finally exits.

Revision history for this message
Martin Pool (mbp) wrote :

It looks good; there's just one nit.

=== modified file 'suiterunner.py'
--- suiterunner.py 2008-07-06 07:35:11 +0000
+++ suiterunner.py 2008-10-08 10:07:00 +0000

@@ -255,6 +256,10 @@
         csv_data = [['Task','Label','Measure','Unit'] + tools]
         index_for_action = {}
         tool_count = len(tools)
+ if 'server_start_cmd' in dynamic_params:
+ exit_code = subprocess.call(dynamic_params['server_start_cmd'], shell=True)
+ assert exit_code == 0, exit_code
+ orig_cwd = os.getcwd()
         for tool_index,tool in enumerate(tools):
             for task_index,task in enumerate(suite.iter_scripts()):
                 initial_params['task_name'] = task.name()
@ -275,4 +280,8 @@
                             csv_data.append([task,label,measure,unit] +
                                 ['-' for i in xrange(tool_count)])
                         csv_data[index][4 + tool_index] = measurement
+ if 'server_stop_cmd' in dynamic_params:
+ os.chdir(orig_cwd)
+ exit_code = subprocess.call(dynamic_params['server_stop_cmd'], shell=True)
+ assert exit_code == 0, exit_code
         return csv_data

Don't use 'assert' when checking the state of the outside world or user input.

Revision history for this message
Martin Pool (mbp) wrote :

oh how bizarre, the comment form doesn't let you set the state

review: Approve (none)
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

You've deleted some code in the AnotherBranch task that shouldn't be deleted: it's important to benchmark the speed of *another* user doing a branch (i.e. initial pull). I appreciate that code is fugly in that it assumes a bzr shared repo as the project archive - but it needs to stay.

Otherwise, this looks good bar poolie's point re asserts.

review: Needs Fixing

Subscribers

People subscribed via source and target branches

to all changes: