Exemplo n.º 1
0
def test_node_run_tests(instance_name='ocgis-test-node', branch='next', failed='false'):
    am = AwsManager()
    instance = am.get_instance_by_name(instance_name)
    tcenv = 'test-ocgis'
    texclude = '!slow,!remote,!esmpy7'
    tgdal_data = '/home/ubuntu/anaconda/envs/{0}/share/gdal'.format(tcenv)
    tocgis_dir_shpcabinet = '/home/ubuntu/data/ocgis_test_data/shp'
    tocgis_dir_test_data = '/home/ubuntu/data/ocgis_test_data/'
    tsrc = '~/git/ocgis/src'

    def _run_():
        senv = dict(OCGIS_DIR_SHPCABINET=tocgis_dir_shpcabinet, OCGIS_DIR_TEST_DATA=tocgis_dir_test_data,
                    GDAL_DATA=tgdal_data)
        with shell_env(**senv):
            with prefix('source activate {0}'.format(tcenv)):
                with cd(tsrc):
                    run('git checkout next')
                    run('git pull')
                    if failed == 'true':
                        cmd = 'cp .noseids /tmp; git checkout {tbranch}; git pull; nosetests -vs --failed --with-id -a {texclude} ocgis/test'
                    else:
                        cmd = 'cp .noseids /tmp; rm .noseids; git checkout {tbranch}; git pull; nosetests -vs --with-id -a {texclude} ocgis/test'
                    cmd = cmd.format(tbranch=branch, texclude=texclude)
                    run(cmd)

    am.do_task(_run_, instance=instance)
Exemplo n.º 2
0
def test_node_run_tests(instance_name='ocgis-test-node',
                        branch='next',
                        failed='false'):
    am = AwsManager()
    instance = am.get_instance_by_name(instance_name)
    tcenv = 'test-ocgis'
    texclude = '!slow,!remote,!esmpy7'
    tgdal_data = '/home/ubuntu/anaconda/envs/{0}/share/gdal'.format(tcenv)
    tocgis_dir_shpcabinet = '/home/ubuntu/data/ocgis_test_data/shp'
    tocgis_dir_test_data = '/home/ubuntu/data/ocgis_test_data/'
    tsrc = '~/git/ocgis/src'

    def _run_():
        senv = dict(OCGIS_DIR_SHPCABINET=tocgis_dir_shpcabinet,
                    OCGIS_DIR_TEST_DATA=tocgis_dir_test_data,
                    GDAL_DATA=tgdal_data)
        with shell_env(**senv):
            with prefix('source activate {0}'.format(tcenv)):
                with cd(tsrc):
                    run('git checkout next')
                    run('git pull')
                    if failed == 'true':
                        cmd = 'cp .noseids /tmp; git checkout {tbranch}; git pull; nosetests -vs --failed --with-id -a {texclude} ocgis/test'
                    else:
                        cmd = 'cp .noseids /tmp; rm .noseids; git checkout {tbranch}; git pull; nosetests -vs --with-id -a {texclude} ocgis/test'
                    cmd = cmd.format(tbranch=branch, texclude=texclude)
                    run(cmd)

    am.do_task(_run_, instance=instance)
Exemplo n.º 3
0
def test_node_ebs_mount(instance_name='ocgis-test-node',
                        ebs_mount_name='/dev/xvdg',
                        ebs_mount_dir='~/data'):
    am = AwsManager()
    instance = am.get_instance_by_name(instance_name)
    kwargs = {'mount_name': ebs_mount_name, 'mount_dir': ebs_mount_dir}
    am.do_task(ebs_mount, instance=instance, kwargs=kwargs)
Exemplo n.º 4
0
def test_node_terminate():
    am = AwsManager()
    instance_name = 'ocgis-test-node'
    instance = am.get_instance_by_name(instance_name)
    instance.terminate()
Exemplo n.º 5
0
def test_node_ebs_mount(instance_name='ocgis-test-node', ebs_mount_name='/dev/xvdg', ebs_mount_dir='~/data'):
    am = AwsManager()
    instance = am.get_instance_by_name(instance_name)
    kwargs = {'mount_name': ebs_mount_name, 'mount_dir': ebs_mount_dir}
    am.do_task(ebs_mount, instance=instance, kwargs=kwargs)
Exemplo n.º 6
0
def test_node_terminate():
    am = AwsManager()
    instance_name = 'ocgis-test-node'
    instance = am.get_instance_by_name(instance_name)
    instance.terminate()