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

update main_repo_location_name to "test" for gql tests #26177

Closed
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GqlAssetCheckHandle(TypedDict):


def main_repo_location_name() -> str:
return "test_location"
return "test"


def main_repo_name() -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,9 @@ def materialize(_):
other=["some constraint"],
),
),
"my job": MetadataValue.job("materialization_job", location_name="test_location"),
"my job": MetadataValue.job(
"materialization_job", location_name=main_repo_location_name()
),
},
)
yield Output(None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
from dagster import job, op, repository
from dagster._core.storage.dagster_run import DagsterRunStatus
from dagster._core.test_utils import instance_for_test
from dagster_graphql.test.utils import define_out_of_process_context, execute_dagster_graphql
from dagster_graphql.test.utils import (
define_out_of_process_context,
execute_dagster_graphql,
main_repo_location_name,
)

RUNS_QUERY = """
query RunsQuery {
Expand Down Expand Up @@ -256,7 +260,7 @@ def test_pipelines_query():
context,
PIPELINES_QUERY,
variables={
"repositoryLocationName": "test_location",
"repositoryLocationName": main_repo_location_name(),
"repositoryName": "my_repo",
},
)
Expand All @@ -273,7 +277,7 @@ def test_launch_mutation():
context,
LAUNCH_PIPELINE,
variables={
"repositoryLocationName": "test_location",
"repositoryLocationName": main_repo_location_name(),
"repositoryName": "my_repo",
"pipelineName": "foo_job",
"runConfigData": {},
Expand All @@ -293,7 +297,7 @@ def test_launch_mutation_error():
context,
LAUNCH_PIPELINE,
variables={
"repositoryLocationName": "test_location",
"repositoryLocationName": main_repo_location_name(),
"repositoryName": "my_repo",
"pipelineName": "foo_job",
"runConfigData": {"invalid": "config"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def call_me():

# Reload the location from the request context
assert not called["yup"]
process_context.reload_code_location("test_location")
process_context.reload_code_location(main_repo_location_name())
assert not called["yup"]

request_context = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
from dagster._core.test_utils import instance_for_test
from dagster._core.types.loadable_target_origin import LoadableTargetOrigin
from dagster._utils import file_relative_path
from dagster_graphql.test.utils import main_repo_location_name, main_repo_name


def test_dagster_out_of_process_location():
with instance_for_test() as instance:
with ManagedGrpcPythonEnvCodeLocationOrigin(
location_name="test_location",
location_name=main_repo_location_name(),
loadable_target_origin=LoadableTargetOrigin(
executable_path=sys.executable,
python_file=file_relative_path(__file__, "repo.py"),
attribute="test_repo",
attribute=main_repo_name(),
),
).create_single_location(instance) as env:
assert env.get_repository("test_repo")
assert env.get_repository(main_repo_name())