Right now, we have a bunch of very cool tests that break every time i do something stupid. Then jenkins tell me I'm stupid and I fix it and I am happy. It's great!

The thing is, it's only in jenkins. If I would have it on my side, maybe I could test this by myself without having to go through jenkins... *and* I wouldn't make so much noise and then my friends would stop laughing at me. ;)

Therefore, I think we should work on a provision-test command, a bit like the drush testing framework, maybe based on php unit or better yet drush's unit testing?

The tests are:

def run_platform_tests():
        fab_install_platform('drupal5')
        fab_install_platform('drupal6')
        fab_install_platform('drupal7')
        fab_install_platform('openatrium')

def run_site_tests():
        print "===> Installing some sites"
        fab_install_site('drupal5', 'default')
        fab_install_site('drupal6', 'default')
        fab_install_site('drupal7', 'standard')
        fab_install_site('openatrium', 'openatrium')

Each of those does a provision-save, a provision-install (or verify) then hosting-import to pull it in the frontend. We also do fancy hosting-task stuff to verify a platform instead of importing the created site.

This is a good start for #1080590: Testing [meta] too, and a followup to #1183926: debian package testing on jenkins.

Comments

steven jones’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
steven jones’s picture

For reference these are the other functions that are called by the above:

# Download, import and verify platforms
def fab_install_platform(platform_name):
        fabric.run("su - -s /bin/sh aegir -c 'php /var/aegir/drush/drush.php make %s/%s.build /var/aegir/platforms/%s'" % (builds_repo, platform_name, platform_name), pty=True)
        fabric.run("su - -s /bin/sh aegir -c 'php /var/aegir/drush/drush.php --root=\'/var/aegir/platforms/%s\' provision-save \'@platform_%s\' --context_type=\'platform\''" % (platform_name, platform_name), pty=True)
        fabric.run("su - -s /bin/sh aegir -c 'php /var/aegir/drush/drush.php @hostmaster hosting-import \'@platform_%s\''" % platform_name, pty=True)
        fab_run_dispatch()

# Install a site
def fab_install_site(platform_name, profile):
        fabric.run("su - -s /bin/sh aegir -c '/var/aegir/drush/drush.php --uri=\'%s.mig5.net\' provision-save \'@%s.mig5.net\' --context_type=\'site\' --platform=\'@platform_%s\' --profile=\'%s\' --db_server=\'@server_localhost\''" % (platform_name, platform_name, platform_name, profile), pty=True)
        fabric.run("su - -s /bin/sh aegir -c '/var/aegir/drush/drush.php @%s.mig5.net provision-install'" % platform_name, pty=True)
        fabric.run("su - -s /bin/sh aegir -c '/var/aegir/drush/drush.php @hostmaster hosting-task @platform_%s verify'" % platform_name, pty=True)
        fab_run_dispatch()

# Force the dispatcher
def fab_run_dispatch():
        fabric.run("su - -s /bin/sh aegir -c 'php /var/aegir/drush/drush.php @hostmaster hosting-dispatch'", pty=True)
steven jones’s picture

Assigned: Unassigned » steven jones
Status: Active » Patch (to be ported)

Okay, so I've factored these tests out, and added them to provision, though they require a full Aegir stack (including hostmaster) to run.

So you can do something like:

drush @hostmaster provision-tests-run

And it'll test installing drupal5, 6, 7 and openatrium at the moment. (Drupal 5 is only tested on PHP 5.2)

I still need to push this into the other dev branches.

steven jones’s picture

Status: Patch (to be ported) » Fixed

Pushed into the other branches too.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.