Skip to content

Commit

Permalink
fix selector injection for k8s-celery test (#7307)
Browse files Browse the repository at this point in the history
  • Loading branch information
prha committed Apr 5, 2022
1 parent 36b189f commit 21c8a12
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
ExternalSchedule,
GrpcServerRepositoryLocationOrigin,
InProcessRepositoryLocationOrigin,
InstigatorSelector,
RepositoryLocation,
)
from dagster.core.host_representation.origin import (
Expand All @@ -29,7 +30,7 @@
RepositoryPythonOrigin,
)
from dagster.core.test_utils import in_process_test_workspace
from dagster.serdes import whitelist_for_serdes
from dagster.serdes import create_snapshot_id, whitelist_for_serdes
from dagster.utils import file_relative_path, git_repository_root

IS_BUILDKITE = os.getenv("BUILDKITE") is not None
Expand Down Expand Up @@ -247,6 +248,19 @@ def get_external_origin(self):
instigator_name=self.name,
)

@property
def selector_id(self):
"""
Hack! Inject a selector that matches the one that the k8s helm chart will use.
"""
return create_snapshot_id(
InstigatorSelector(
"user-code-deployment-1",
"demo_execution_repo",
self.name,
)
)


@contextmanager
def get_test_project_workspace(instance, container_image=None):
Expand Down

0 comments on commit 21c8a12

Please sign in to comment.