Example #1
0
def exec_ctx(make_exec_ctx, scheduler):
    if test_util.USER_CONFIG_FILE and scheduler.registered_name != 'local':
        make_exec_ctx(test_util.USER_CONFIG_FILE, test_util.USER_SYSTEM)
    else:
        make_exec_ctx(test_util.TEST_CONFIG_FILE, 'generic')

    if scheduler.registered_name == 'squeue':
        # slurm backend fulfills the functionality of the squeue backend, so
        # if squeue is not configured, use slurm instead
        partition = (test_util.partition_by_scheduler('squeue')
                     or test_util.partition_by_scheduler('slurm'))
    else:
        partition = test_util.partition_by_scheduler(scheduler.registered_name)

    if partition is None:
        pytest.skip(f"scheduler '{scheduler.registered_name}' not configured")

    return partition
Example #2
0
def test_remote_autodetect(remote_exec_ctx):
    # All we can do with this test is to trigger the remote auto-detection
    # path; since we don't know what the remote user system is, we cannot test
    # if the topology is right.
    partition = test_util.partition_by_scheduler()
    if not partition:
        pytest.skip('job submission not supported')

    autodetect.detect_topology()
def local_user_exec_ctx(user_system):
    partition = test_util.partition_by_scheduler('local')
    if partition is None:
        pytest.skip('no local jobs are supported')

    try:
        environ = partition.environs[0]
    except IndexError:
        pytest.skip(
            f'no environments configured for partition: {partition.fullname}')

    yield partition, environ
def remote_exec_ctx(user_system):
    partition = test_util.partition_by_scheduler()
    if partition is None:
        pytest.skip('job submission not supported')

    try:
        environ = partition.environs[0]
    except IndexError:
        pytest.skip(
            f'no environments configured for partition: {partition.fullname}')

    yield partition, environ
Example #5
0
def remote_exec_ctx(user_exec_ctx):
    partition = test_util.partition_by_scheduler()
    if not partition:
        pytest.skip('job submission not supported')

    return partition, partition.environs[0]