Differential D4827 Diff 24066 python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_mutations.py
Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_mutations.py
import re | import re | ||||
import pytest | import pytest | ||||
from dagster_graphql.client.mutations import ( | from dagster_graphql.client.mutations import ( | ||||
DagsterGraphQLClientError, | DagsterGraphQLClientError, | ||||
execute_execute_plan_mutation, | execute_execute_plan_mutation, | ||||
execute_execute_plan_mutation_raw, | execute_execute_plan_mutation_raw, | ||||
) | ) | ||||
from dagster import file_relative_path | from dagster import file_relative_path | ||||
from dagster.cli.workspace.cli_target import PythonFileTarget, workspace_from_load_target | from dagster.cli.workspace.cli_target import PythonFileTarget, workspace_from_load_target | ||||
from dagster.core.definitions.reconstructable import ( | from dagster.core.definitions.reconstructable import ( | ||||
ReconstructablePipeline, | ReconstructablePipeline, | ||||
get_ephemeral_repository_name, | get_ephemeral_repository_name, | ||||
) | ) | ||||
from dagster.core.host_representation.handle import IN_PROCESS_NAME | from dagster.core.host_representation.handle import ( | ||||
IN_PROCESS_NAME, | |||||
get_default_repository_location_name, | |||||
) | |||||
from dagster.core.instance import DagsterInstance | from dagster.core.instance import DagsterInstance | ||||
from dagster.utils.hosted_user_process import create_in_process_ephemeral_workspace | from dagster.utils.hosted_user_process import create_in_process_ephemeral_workspace | ||||
EXPECTED_EVENTS = { | EXPECTED_EVENTS = { | ||||
("STEP_INPUT", "sleeper.compute"), | ("STEP_INPUT", "sleeper.compute"), | ||||
("STEP_INPUT", "sleeper_2.compute"), | ("STEP_INPUT", "sleeper_2.compute"), | ||||
("STEP_INPUT", "sleeper_3.compute"), | ("STEP_INPUT", "sleeper_3.compute"), | ||||
("STEP_INPUT", "sleeper_4.compute"), | ("STEP_INPUT", "sleeper_4.compute"), | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | def test_execute_execute_plan_mutation_out_of_process_fails(): | ||||
pipeline = sleepy_recon_pipeline() | pipeline = sleepy_recon_pipeline() | ||||
workspace = load_sleepy_workspace(instance) | workspace = load_sleepy_workspace(instance) | ||||
pipeline_run = instance.create_run_for_pipeline(pipeline_def=pipeline.get_definition()) | pipeline_run = instance.create_run_for_pipeline(pipeline_def=pipeline.get_definition()) | ||||
variables = { | variables = { | ||||
"executionParams": { | "executionParams": { | ||||
"runConfigData": {}, | "runConfigData": {}, | ||||
"mode": "default", | "mode": "default", | ||||
"selector": { | "selector": { | ||||
"repositoryLocationName": get_ephemeral_repository_name(pipeline_name), | "repositoryLocationName": get_default_repository_location_name( | ||||
get_ephemeral_repository_name(pipeline_name) | |||||
), | |||||
"repositoryName": get_ephemeral_repository_name(pipeline_name), | "repositoryName": get_ephemeral_repository_name(pipeline_name), | ||||
"pipelineName": pipeline_name, | "pipelineName": pipeline_name, | ||||
}, | }, | ||||
"executionMetadata": {"runId": pipeline_run.run_id}, | "executionMetadata": {"runId": pipeline_run.run_id}, | ||||
} | } | ||||
} | } | ||||
with pytest.raises( | with pytest.raises( | ||||
DagsterGraphQLClientError, | DagsterGraphQLClientError, | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |