Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set all graphql context test suites to use code location test_location #26174

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python_modules/dagster-graphql/dagster_graphql/test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
)
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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

Expand Down
Loading