Ejemplo n.º 1
0
def test_execute_execute_plan_mutation_raw():
    pipeline_name = 'sleepy_pipeline'
    workspace = workspace_from_load_target(
        ModuleTarget('dagster_examples.toys.sleepy', pipeline_name))
    pipeline = ReconstructablePipeline.for_module(
        'dagster_examples.toys.sleepy', pipeline_name)

    instance = DagsterInstance.local_temp()
    pipeline_run = instance.create_run_for_pipeline(
        pipeline_def=pipeline.get_definition())
    variables = {
        'executionParams': {
            'runConfigData': {},
            'mode': 'default',
            'selector': {
                'repositoryLocationName': pipeline_name,
                'repositoryName': '<<unnamed>>',
                'pipelineName': pipeline_name,
            },
            'executionMetadata': {
                'runId': pipeline_run.run_id
            },
        }
    }
    result = execute_execute_plan_mutation_raw(workspace,
                                               variables,
                                               instance_ref=instance.get_ref())
    seen_events = set()
    for event in result:
        seen_events.add((event.dagster_event.event_type_value, event.step_key))

    assert seen_events == EXPECTED_EVENTS
Ejemplo n.º 2
0
def test_execute_execute_plan_mutation_raw():
    pipeline_name = 'sleepy_pipeline'
    handle = ExecutionTargetHandle.for_pipeline_module(
        'dagster_examples.toys.sleepy', pipeline_name)
    pipeline = handle.build_pipeline_definition()
    instance = DagsterInstance.local_temp()
    pipeline_run = instance.create_run_for_pipeline(pipeline=pipeline)
    variables = {
        'executionParams': {
            'environmentConfigData': {},
            'mode': 'default',
            'selector': {
                'name': pipeline_name
            },
            'executionMetadata': {
                'runId': pipeline_run.run_id
            },
        }
    }
    result = execute_execute_plan_mutation_raw(handle,
                                               variables,
                                               instance_ref=instance.get_ref())
    seen_events = set()
    for event in result:
        seen_events.add((event.dagster_event.event_type_value, event.step_key))

    assert seen_events == EXPECTED_EVENTS
Ejemplo n.º 3
0
def test_execute_execute_plan_mutation_raw():
    pipeline_name = "sleepy_pipeline"
    pipeline = sleepy_recon_pipeline()
    instance = DagsterInstance.local_temp()

    workspace = create_in_process_ephemeral_workspace(
        pointer=pipeline.repository.pointer)

    pipeline_run = instance.create_run_for_pipeline(
        pipeline_def=pipeline.get_definition())
    variables = {
        "executionParams": {
            "runConfigData": {},
            "mode": "default",
            "selector": {
                "repositoryLocationName": IN_PROCESS_NAME,
                "repositoryName": get_ephemeral_repository_name(pipeline_name),
                "pipelineName": pipeline_name,
            },
            "executionMetadata": {
                "runId": pipeline_run.run_id
            },
        }
    }
    result = execute_execute_plan_mutation_raw(workspace,
                                               variables,
                                               instance_ref=instance.get_ref())
    seen_events = set()
    for event in result:
        seen_events.add((event.dagster_event.event_type_value, event.step_key))

    assert seen_events == EXPECTED_EVENTS
Ejemplo n.º 4
0
def test_execute_execute_plan_mutation_raw():
    pipeline_name = 'sleepy_pipeline'
    pipeline = sleepy_recon_pipeline()
    instance = DagsterInstance.local_temp()

    workspace = load_sleepy_workspace(instance)

    pipeline_run = instance.create_run_for_pipeline(pipeline_def=pipeline.get_definition())
    variables = {
        'executionParams': {
            'runConfigData': {},
            'mode': 'default',
            'selector': {
                'repositoryLocationName': get_ephemeral_repository_name(pipeline_name),
                'repositoryName': get_ephemeral_repository_name(pipeline_name),
                'pipelineName': pipeline_name,
            },
            'executionMetadata': {'runId': pipeline_run.run_id},
        }
    }
    result = execute_execute_plan_mutation_raw(
        workspace, variables, instance_ref=instance.get_ref()
    )
    seen_events = set()
    for event in result:
        seen_events.add((event.dagster_event.event_type_value, event.step_key))

    assert seen_events == EXPECTED_EVENTS
Ejemplo n.º 5
0
def test_execute_execute_plan_mutation_raw():
    pipeline_name = 'sleepy_pipeline'
    handle = ExecutionTargetHandle.for_pipeline_module(
        'dagster_examples.toys.sleepy', pipeline_name)
    variables = {
        'executionParams': {
            'environmentConfigData': {},
            'mode': 'default',
            'selector': {
                'name': pipeline_name
            },
            'executionMetadata': {
                'runId': '12345'
            },
        }
    }
    result = execute_execute_plan_mutation_raw(handle, variables)
    seen_events = set()
    for event in result:
        seen_events.add((event.dagster_event.event_type_value, event.step_key))

    assert seen_events == EXPECTED_EVENTS