← Back to team overview

yellow team mailing list archive

[Merge] lp:~frankban/lpsetup/handle-testing into lp:lpsetup

 

Francesco Banconi has proposed merging lp:~frankban/lpsetup/handle-testing into lp:lpsetup.

Requested reviews:
  Yellow Squad (yellow)

For more details, see:
https://code.launchpad.net/~frankban/lpsetup/handle-testing/+merge/116419

== Changes ==

Added --testing option to install-lxc (also re-activated handle_testing()).

--testing is now an alias for --no-checkout and --use-http too.

Simplified install-lxc steps composition (as suggested by Gary in a previous review).

-- 
https://code.launchpad.net/~frankban/lpsetup/handle-testing/+merge/116419
Your team Yellow Squad is requested to review the proposed merge of lp:~frankban/lpsetup/handle-testing into lp:lpsetup.
=== modified file 'lpsetup/handlers.py'
--- lpsetup/handlers.py	2012-07-20 15:10:49 +0000
+++ lpsetup/handlers.py	2012-07-24 08:38:19 +0000
@@ -280,7 +280,9 @@
     if getattr(namespace, 'testing', False):
         namespace.create_scripts = True
         namespace.install_subunit = True
+        namespace.no_checkout = True
         namespace.stop_lxc = True
+        namespace.use_http = True
 
 
 def handle_source(namespace):

=== modified file 'lpsetup/subcommands/install_lxc.py'
--- lpsetup/subcommands/install_lxc.py	2012-07-20 16:18:59 +0000
+++ lpsetup/subcommands/install_lxc.py	2012-07-24 08:38:19 +0000
@@ -17,6 +17,7 @@
     handle_directories,
     handle_source,
     handle_target_from_repository,
+    handle_testing,
     )
 from lpsetup.settings import (
     LXC_IP_COMMAND,
@@ -120,7 +121,9 @@
          'external_path', 'target_dir', 'use_http'),
         (finish_inithost_in_lxc, 'lxc_name', 'ssh_key_path', 'home_dir',
          'user', 'target_dir'),
-        ) + (initlxc.SubCommand.stop_lxc_step,)
+        # Run on host:
+        initlxc.SubCommand.stop_lxc_step,
+        )
 
     help = __doc__
 
@@ -131,6 +134,7 @@
             handle_branch_and_checkout,
             handle_source,
             handle_target_from_repository,
+            handle_testing,
             )
 
     def call_create_scripts(self, namespace, step, args):
@@ -147,3 +151,7 @@
         parser.add_argument(
             '-C', '--create-scripts', action='store_true',
             help='Create the scripts used by buildbot for parallel testing.')
+        parser.add_argument(
+            '--testing', action='store_true',
+            help='Alias for --create-scripts --install-subunit --no-checkout '
+                 '--stop_lxc --use-http.')

=== modified file 'lpsetup/tests/subcommands/test_install_lxc.py'
--- lpsetup/tests/subcommands/test_install_lxc.py	2012-07-20 16:18:59 +0000
+++ lpsetup/tests/subcommands/test_install_lxc.py	2012-07-24 08:38:19 +0000
@@ -55,12 +55,14 @@
         handlers.handle_branch_and_checkout,
         handlers.handle_source,
         handlers.handle_target_from_repository,
+        handlers.handle_testing,
         )
     expected_steps = test_initlxc.InitLxcTest.expected_steps[:-1] + (
         create_scripts_step,
         init_repo_in_lxc_step,
         update_in_lxc_step,
         finish_inithost_in_lxc_step,
-        ) + (test_initlxc.stop_lxc_step,)
+        test_initlxc.stop_lxc_step,
+        )
     needs_root = True
     maxDiff = None

=== modified file 'lpsetup/tests/test_handlers.py'
--- lpsetup/tests/test_handlers.py	2012-07-20 14:52:15 +0000
+++ lpsetup/tests/test_handlers.py	2012-07-24 08:38:19 +0000
@@ -312,7 +312,9 @@
     ctx = {
         'create_scripts': True,
         'install_subunit': False,
+        'no_checkout': True,
         'stop_lxc': False,
+        'use_http': False,
         }
 
     def test_true(self):


Follow ups