Differential D4742 Diff 24115 python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_all_snapshot_ids.py
Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_all_snapshot_ids.py
from dagster.core.test_utils import instance_for_test | |||||
from dagster.serdes import serialize_pp | from dagster.serdes import serialize_pp | ||||
from .setup import get_main_external_repo | from .setup import get_main_external_repo | ||||
def test_all_snapshot_ids(snapshot): | def test_all_snapshot_ids(snapshot): | ||||
# This ensures that pipeline snapshots remain stable | # This ensures that pipeline snapshots remain stable | ||||
# If you 1) change any pipelines in dagster_graphql_test or 2) change the | # If you 1) change any pipelines in dagster_graphql_test or 2) change the | ||||
# schema of PipelineSnapshots you are free to rerecord | # schema of PipelineSnapshots you are free to rerecord | ||||
repo = get_main_external_repo() | with instance_for_test() as instance: | ||||
repo = get_main_external_repo(instance) | |||||
for pipeline in sorted(repo.get_all_external_pipelines(), key=lambda p: p.name): | for pipeline in sorted(repo.get_all_external_pipelines(), key=lambda p: p.name): | ||||
snapshot.assert_match(serialize_pp(pipeline.pipeline_snapshot)) | snapshot.assert_match(serialize_pp(pipeline.pipeline_snapshot)) | ||||
snapshot.assert_match(pipeline.computed_pipeline_snapshot_id) | snapshot.assert_match(pipeline.computed_pipeline_snapshot_id) |