From a89676f180ce020389e32f94eb1ac65f2c3db358 Mon Sep 17 00:00:00 2001 From: JamieDeMaria Date: Mon, 2 Dec 2024 13:17:09 -0500 Subject: [PATCH] fix tests --- .../dagster_graphql/test/utils.py | 4 +- .../test_reload_repository_location.py | 3 +- .../test_shutdown_repository_location.py | 6 +-- .../graphql/multi_location.yaml | 2 +- .../graphql/test_assets.py | 17 ++++--- .../graphql/test_graph.py | 17 +++++-- .../graphql/test_partition_backfill.py | 19 ++++---- .../test_reload_repository_location.py | 46 +++++++++++-------- .../graphql/test_retry_execution.py | 3 +- .../graphql/test_runs_feed.py | 4 +- .../graphql/test_workspace.py | 8 ++-- 11 files changed, 77 insertions(+), 52 deletions(-) diff --git a/python_modules/dagster-graphql/dagster_graphql/test/utils.py b/python_modules/dagster-graphql/dagster_graphql/test/utils.py index 27a051ea6de7a..cb52d1c34c646 100644 --- a/python_modules/dagster-graphql/dagster_graphql/test/utils.py +++ b/python_modules/dagster-graphql/dagster_graphql/test/utils.py @@ -165,7 +165,7 @@ def infer_repository(graphql_context: WorkspaceRequestContext) -> RemoteReposito assert len(repositories) == 1 return next(iter(repositories.values())) - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) return code_location.get_repository("test_repo") @@ -177,7 +177,7 @@ def infer_repository_selector(graphql_context: WorkspaceRequestContext) -> Selec assert len(repositories) == 1 repository = next(iter(repositories.values())) else: - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") return { diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_reload_repository_location.py b/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_reload_repository_location.py index 1fa645a7f2174..0eecd4e5a4bc8 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_reload_repository_location.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_reload_repository_location.py @@ -2,6 +2,7 @@ import pytest from dagster_graphql import DagsterGraphQLClientError, ReloadRepositoryLocationStatus +from dagster_graphql.test.utils import main_repo_location_name from dagster_graphql_tests.client_tests.conftest import MockClient, python_client_test_suite from dagster_graphql_tests.graphql.graphql_context_test_suite import ( @@ -96,6 +97,6 @@ def test_failure_with_query_error(mock_client: MockClient): class TestReloadRepositoryLocationWithClient(BaseTestSuite): def test_reload_location_real(self, graphql_client): assert ( - graphql_client.reload_repository_location("test").status + graphql_client.reload_repository_location(main_repo_location_name()).status == ReloadRepositoryLocationStatus.SUCCESS ) diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_shutdown_repository_location.py b/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_shutdown_repository_location.py index aab0b1cf8f769..94caba8239772 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_shutdown_repository_location.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_shutdown_repository_location.py @@ -4,7 +4,7 @@ from dagster._core.errors import DagsterUserCodeUnreachableError from dagster_graphql import ShutdownRepositoryLocationStatus from dagster_graphql.client.client_queries import SHUTDOWN_REPOSITORY_LOCATION_MUTATION -from dagster_graphql.test.utils import execute_dagster_graphql +from dagster_graphql.test.utils import execute_dagster_graphql, main_repo_location_name from dagster_graphql_tests.graphql.graphql_context_test_suite import ( GraphQLContextVariant, @@ -22,7 +22,7 @@ def test_shutdown_repository_location_permission_failure(self, graphql_context): result = execute_dagster_graphql( graphql_context, SHUTDOWN_REPOSITORY_LOCATION_MUTATION, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -36,7 +36,7 @@ def test_shutdown_repository_location(self, graphql_client, graphql_context): origin = next(iter(graphql_context.get_code_location_entries().values())).origin origin.create_client().heartbeat() - result = graphql_client.shutdown_repository_location("test") + result = graphql_client.shutdown_repository_location(main_repo_location_name()) assert result.status == ShutdownRepositoryLocationStatus.SUCCESS, result.message diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/multi_location.yaml b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/multi_location.yaml index c1561f56259ac..59f462386aa75 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/multi_location.yaml +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/multi_location.yaml @@ -6,4 +6,4 @@ load_from: - python_file: relative_path: repo.py attribute: test_repo - location_name: test + location_name: test_location diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_assets.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_assets.py index f6e18b05942c0..0901f0b9af9da 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_assets.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_assets.py @@ -38,6 +38,7 @@ execute_dagster_graphql, infer_job_selector, infer_repository_selector, + main_repo_location_name, ) from dagster_graphql_tests.graphql.graphql_context_test_suite import ( @@ -1241,7 +1242,7 @@ def test_asset_node_in_pipeline(self, graphql_context: WorkspaceRequestContext): assert len(result.data["assetNodes"]) == 1 asset_node = result.data["assetNodes"][0] - assert asset_node["id"] == 'test.test_repo.["asset_one"]' + assert asset_node["id"] == f'{main_repo_location_name()}.test_repo.["asset_one"]' assert asset_node["hasMaterializePermission"] assert asset_node["hasReportRunlessAssetEventPermission"] @@ -1256,7 +1257,7 @@ def test_asset_node_in_pipeline(self, graphql_context: WorkspaceRequestContext): assert len(result.data["assetNodes"]) == 2 asset_node = result.data["assetNodes"][0] - assert asset_node["id"] == 'test.test_repo.["asset_one"]' + assert asset_node["id"] == f'{main_repo_location_name()}.test_repo.["asset_one"]' def test_asset_node_is_executable(self, graphql_context: WorkspaceRequestContext): result = execute_dagster_graphql( @@ -2126,7 +2127,7 @@ def test_reexecute_subset(self, graphql_context: WorkspaceRequestContext): def test_named_groups(self, graphql_context: WorkspaceRequestContext): _create_run(graphql_context, "named_groups_job") selector = { - "repositoryLocationName": "test", + "repositoryLocationName": main_repo_location_name(), "repositoryName": "test_repo", } @@ -2640,7 +2641,7 @@ def test_auto_materialize_policy(self, graphql_context: WorkspaceRequestContext) fresh_diamond_bottom = [ a for a in result.data["assetNodes"] - if a["id"] == 'test.test_repo.["fresh_diamond_bottom"]' + if a["id"] == f'{main_repo_location_name()}.test_repo.["fresh_diamond_bottom"]' ] assert len(fresh_diamond_bottom) == 1 assert fresh_diamond_bottom[0]["autoMaterializePolicy"]["policyType"] == "LAZY" @@ -2654,7 +2655,8 @@ def test_automation_condition(self, graphql_context: WorkspaceRequestContext): automation_condition_asset = [ a for a in result.data["assetNodes"] - if a["id"] == 'test.test_repo.["asset_with_automation_condition"]' + if a["id"] + == f'{main_repo_location_name()}.test_repo.["asset_with_automation_condition"]' ] assert len(automation_condition_asset) == 1 condition = automation_condition_asset[0]["automationCondition"] @@ -2664,7 +2666,8 @@ def test_automation_condition(self, graphql_context: WorkspaceRequestContext): custom_automation_condition_asset = [ a for a in result.data["assetNodes"] - if a["id"] == 'test.test_repo.["asset_with_custom_automation_condition"]' + if a["id"] + == f'{main_repo_location_name()}.test_repo.["asset_with_custom_automation_condition"]' ] assert len(custom_automation_condition_asset) == 1 condition = custom_automation_condition_asset[0]["automationCondition"] @@ -3084,7 +3087,7 @@ def test_asset_unstarted_after_materialization(self, graphql_context: WorkspaceR ) # Create two enqueued runs - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") job = repository.get_full_job("hanging_job") diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graph.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graph.py index 904c4bd608328..f21deae63d660 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graph.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graph.py @@ -1,5 +1,9 @@ from dagster._core.workspace.context import WorkspaceRequestContext -from dagster_graphql.test.utils import execute_dagster_graphql, infer_repository_selector +from dagster_graphql.test.utils import ( + execute_dagster_graphql, + infer_repository_selector, + main_repo_location_name, +) from dagster_graphql_tests.graphql.graphql_context_test_suite import ( NonLaunchableGraphQLContextTestMatrix, @@ -74,12 +78,17 @@ def test_basic_jobs(self, graphql_context: WorkspaceRequestContext): repo_locations = { blob["name"]: blob for blob in result.data["workspaceOrError"]["locationEntries"] } - assert "test" in repo_locations - assert repo_locations["test"]["locationOrLoadError"]["__typename"] == "RepositoryLocation" + assert main_repo_location_name() in repo_locations + assert ( + repo_locations[main_repo_location_name()]["locationOrLoadError"]["__typename"] + == "RepositoryLocation" + ) jobs = { blob["name"]: blob - for blob in repo_locations["test"]["locationOrLoadError"]["repositories"][0]["jobs"] + for blob in repo_locations[main_repo_location_name()]["locationOrLoadError"][ + "repositories" + ][0]["jobs"] } assert "simple_job_a" in jobs diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_partition_backfill.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_partition_backfill.py index f645ec05d7c71..073462d08a153 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_partition_backfill.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_partition_backfill.py @@ -43,6 +43,7 @@ execute_dagster_graphql_and_finish_runs, infer_job_selector, infer_repository_selector, + main_repo_location_name, ) from dagster_graphql_tests.graphql.graphql_context_test_suite import ( @@ -324,7 +325,7 @@ def dummy_asset(): class TestPartitionBackillReadonlyFailure(ReadonlyGraphQLContextTestMatrix): def _create_backfill(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") backfill = PartitionBackfill( @@ -656,7 +657,7 @@ def test_cancel_asset_backfill(self, graphql_context): # Update asset backfill data to contain requested partition, but does not execute side effects, # since launching the run will cause test process will hang forever. - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph _execute_asset_backfill_iteration_no_side_effects(graphql_context, backfill_id, asset_graph) @@ -732,7 +733,7 @@ def test_cancel_then_retry_asset_backfill(self, graphql_context): # Update asset backfill data to contain requested partition, but does not execute side effects, # since launching the run will cause test process will hang forever. - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph _execute_asset_backfill_iteration_no_side_effects(graphql_context, backfill_id, asset_graph) @@ -1043,7 +1044,7 @@ def test_asset_backfill_partition_stats(self, graphql_context): assert result.data["launchPartitionBackfill"]["__typename"] == "LaunchBackfillSuccess" backfill_id = result.data["launchPartitionBackfill"]["backfillId"] - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph @@ -1086,7 +1087,7 @@ def test_asset_backfill_partition_stats(self, graphql_context): assert asset_partition_status_counts[0]["numPartitionsFailed"] == 2 def test_asset_backfill_status_with_upstream_failure(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph @@ -1557,7 +1558,7 @@ def test_launch_backfill_with_all_partitions_flag(self, graphql_context): assert len(result.data["partitionBackfillOrError"]["partitionNames"]) == 10 def test_reexecute_asset_backfill_from_failure(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph @@ -1654,7 +1655,7 @@ def test_reexecute_asset_backfill_from_failure(self, graphql_context): assert retried_backfill.tags.get(ROOT_BACKFILL_ID_TAG) == backfill_id def test_reexecute_successful_asset_backfill(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph @@ -1741,7 +1742,7 @@ def test_reexecute_successful_asset_backfill(self, graphql_context): assert retried_backfill.tags.get(ROOT_BACKFILL_ID_TAG) == backfill_id def test_reexecute_asset_backfill_still_in_progress(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph @@ -1865,7 +1866,7 @@ def test_reexecute_asset_backfill_still_in_progress(self, graphql_context): assert retried_backfill.tags.get(ROOT_BACKFILL_ID_TAG) == backfill_id def test_reexecute_asset_backfill_twice(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py index cd7928bd61058..801c23152d52a 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py @@ -9,7 +9,7 @@ from dagster._core.types.loadable_target_origin import LoadableTargetOrigin from dagster._core.workspace.load import location_origins_from_yaml_paths from dagster._grpc.types import ListRepositoriesResponse -from dagster_graphql.test.utils import execute_dagster_graphql +from dagster_graphql.test.utils import execute_dagster_graphql, main_repo_location_name from dagster_graphql_tests.graphql.graphql_context_test_suite import ( GraphQLContextVariant, @@ -252,7 +252,9 @@ def test_reload_workspace(self, graphql_context): class TestReloadRepositoriesReadOnly(ReadonlyGraphQLContextTestMatrix): def test_reload_repository_permission_failure(self, graphql_context): result = execute_dagster_graphql( - graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, {"repositoryLocationName": "test"} + graphql_context, + RELOAD_REPOSITORY_LOCATION_QUERY, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -264,14 +266,16 @@ def test_reload_repository_permission_failure(self, graphql_context): class TestReloadRepositoriesOutOfProcess(OutOfProcessTestSuite): def test_out_of_process_reload_location(self, graphql_context): result = execute_dagster_graphql( - graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, {"repositoryLocationName": "test"} + graphql_context, + RELOAD_REPOSITORY_LOCATION_QUERY, + {"repositoryLocationName": main_repo_location_name()}, ) assert result assert result.data assert result.data["reloadRepositoryLocation"] assert result.data["reloadRepositoryLocation"]["__typename"] == "WorkspaceLocationEntry" - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() repositories = result.data["reloadRepositoryLocation"]["locationOrLoadError"][ "repositories" ] @@ -315,7 +319,7 @@ def new_repo(): result = execute_dagster_graphql( graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert cli_command_mock.call_count == 1 @@ -329,7 +333,9 @@ def new_repo(): def test_reload_failure(self, graphql_context): result = execute_dagster_graphql( - graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, {"repositoryLocationName": "test"} + graphql_context, + RELOAD_REPOSITORY_LOCATION_QUERY, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -339,7 +345,7 @@ def test_reload_failure(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "RepositoryLocation" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() repositories = result.data["reloadRepositoryLocation"]["locationOrLoadError"][ "repositories" ] @@ -361,7 +367,7 @@ def test_reload_failure(self, graphql_context): result = execute_dagster_graphql( graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -371,7 +377,7 @@ def test_reload_failure(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "PythonError" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() assert ( "Mocked repository load failure" in result.data["reloadRepositoryLocation"]["locationOrLoadError"]["message"] @@ -381,7 +387,7 @@ def test_reload_failure(self, graphql_context): result = execute_dagster_graphql( graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -391,7 +397,7 @@ def test_reload_failure(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "PythonError" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() assert ( "Mocked repository load failure" in result.data["reloadRepositoryLocation"]["locationOrLoadError"]["message"] @@ -401,7 +407,7 @@ def test_reload_failure(self, graphql_context): result = execute_dagster_graphql( graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -411,7 +417,7 @@ def test_reload_failure(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "RepositoryLocation" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() assert result.data["reloadRepositoryLocation"]["loadStatus"] == "LOADED" repositories = result.data["reloadRepositoryLocation"]["locationOrLoadError"][ "repositories" @@ -427,7 +433,9 @@ def test_reload_failure(self, graphql_context): class TestReloadRepositoriesManagedGrpc(ManagedTestSuite): def test_managed_grpc_reload_location(self, graphql_context): result = execute_dagster_graphql( - graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, {"repositoryLocationName": "test"} + graphql_context, + RELOAD_REPOSITORY_LOCATION_QUERY, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -437,7 +445,7 @@ def test_managed_grpc_reload_location(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "RepositoryLocation" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() assert result.data["reloadRepositoryLocation"]["loadStatus"] == "LOADED" repositories = result.data["reloadRepositoryLocation"]["locationOrLoadError"][ @@ -465,12 +473,12 @@ class TestReloadLocationCodeServerCliGrpc(CodeServerCliTestSuite): def test_code_server_cli_reload_location(self, graphql_context): # server_id before - old_server_id = graphql_context.get_code_location("test").server_id + old_server_id = graphql_context.get_code_location(main_repo_location_name()).server_id result = execute_dagster_graphql( graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -480,12 +488,12 @@ def test_code_server_cli_reload_location(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "RepositoryLocation" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() assert result.data["reloadRepositoryLocation"]["loadStatus"] == "LOADED" new_location = ( graphql_context.process_context.get_workspace_snapshot() - .code_location_entries["test"] + .code_location_entries[main_repo_location_name()] .code_location ) diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_retry_execution.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_retry_execution.py index 0442242d02619..9d51a84c69147 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_retry_execution.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_retry_execution.py @@ -18,6 +18,7 @@ execute_dagster_graphql, execute_dagster_graphql_and_finish_runs, infer_job_selector, + main_repo_location_name, ) from dagster_graphql_tests.graphql.graphql_context_test_suite import ( @@ -69,7 +70,7 @@ class TestRetryExecutionReadonly(ReadonlyGraphQLContextTestMatrix): def test_retry_execution_permission_failure(self, graphql_context: WorkspaceRequestContext): selector = infer_job_selector(graphql_context, "eventually_successful") - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") remote_job_origin = repository.get_full_job("eventually_successful").get_remote_origin() diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_runs_feed.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_runs_feed.py index 2455e716759f6..b6bc8d9ff5003 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_runs_feed.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_runs_feed.py @@ -12,7 +12,7 @@ from dagster._core.utils import make_new_backfill_id from dagster._time import get_current_timestamp from dagster_graphql.implementation.fetch_runs import RunsFeedCursor -from dagster_graphql.test.utils import execute_dagster_graphql +from dagster_graphql.test.utils import execute_dagster_graphql, main_repo_location_name from dagster_graphql_tests.graphql.graphql_context_test_suite import ( ExecutingGraphQLContextTestMatrix, @@ -951,7 +951,7 @@ def test_get_runs_feed_filter_create_time(self, graphql_context): def test_get_runs_feed_filter_job_name(self, graphql_context): if not self.supports_filtering(): return pytest.skip("storage does not support filtering backfills by job_name") - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") partition_set_origin = RemotePartitionSetOrigin( diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_workspace.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_workspace.py index 69b78b26918e7..6fb588b26e34f 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_workspace.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_workspace.py @@ -11,7 +11,7 @@ from dagster._core.types.loadable_target_origin import LoadableTargetOrigin from dagster._core.workspace.load import location_origins_from_yaml_paths from dagster.version import __version__ as dagster_version -from dagster_graphql.test.utils import execute_dagster_graphql +from dagster_graphql.test.utils import execute_dagster_graphql, main_repo_location_name from dagster_graphql.version import __version__ as dagster_graphql_version from dagster_graphql_tests.graphql.graphql_context_test_suite import ( @@ -329,7 +329,9 @@ def test_load_workspace_masked(self, graphql_context, enable_masking_user_code_e ) def test_workspace_entry_by_name(self, graphql_context) -> None: - result = execute_dagster_graphql(graphql_context, LOCATION_ENTRY_QUERY, {"name": "test"}) + result = execute_dagster_graphql( + graphql_context, LOCATION_ENTRY_QUERY, {"name": main_repo_location_name()} + ) assert result assert result.data["workspaceLocationEntryOrError"] assert ( @@ -352,7 +354,7 @@ def test_workspace_entry_by_name(self, graphql_context) -> None: mock_fetch.side_effect = Exception("boom") result = execute_dagster_graphql( - graphql_context, LOCATION_ENTRY_QUERY, {"name": "test"} + graphql_context, LOCATION_ENTRY_QUERY, {"name": main_repo_location_name()} ) assert result assert result.data["workspaceLocationEntryOrError"]