From 4da51010bfa7d972fb68a6f2759c625c80a3d9a7 Mon Sep 17 00:00:00 2001 From: Trevor Blanchard <55503092+ttblanchard@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:35:33 -0500 Subject: [PATCH] Fix tests and linters Signed-off-by: Trevor Blanchard <55503092+ttblanchard@users.noreply.github.com> --- src/deadline_test_fixtures/deadline/worker.py | 3 +++ src/deadline_test_fixtures/fixtures.py | 3 ++- test/unit/deadline/test_worker.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/deadline_test_fixtures/deadline/worker.py b/src/deadline_test_fixtures/deadline/worker.py index 515f099..0e36f02 100644 --- a/src/deadline_test_fixtures/deadline/worker.py +++ b/src/deadline_test_fixtures/deadline/worker.py @@ -160,6 +160,9 @@ def configure_worker_command( @abc.abstractmethod def get_worker_id(self) -> str: raise NotImplementedError("'get_worker_id' was not implemented.") + + def userdata(self, s3_files) -> str: + raise NotImplementedError("'userdata' was not implemented.") def start(self) -> None: s3_files = self._stage_s3_bucket() diff --git a/src/deadline_test_fixtures/fixtures.py b/src/deadline_test_fixtures/fixtures.py index 35f7b36..228f936 100644 --- a/src/deadline_test_fixtures/fixtures.py +++ b/src/deadline_test_fixtures/fixtures.py @@ -31,6 +31,7 @@ PipInstall, PosixInstanceWorker, WindowsInstanceWorker, + EC2InstanceWorker, ) from .models import ( CodeArtifactRepositoryInfo, @@ -513,7 +514,7 @@ def ec2_worker_type(request: pytest.FixtureRequest) -> Generator[Type[DeadlineWo def worker( request: pytest.FixtureRequest, worker_config: DeadlineWorkerConfiguration, - ec2_worker_type: Type[DeadlineWorker], + ec2_worker_type: Type[EC2InstanceWorker], ) -> Generator[DeadlineWorker, None, None]: """ Gets a DeadlineWorker for use in tests. diff --git a/test/unit/deadline/test_worker.py b/test/unit/deadline/test_worker.py index d23c21d..127967d 100644 --- a/test/unit/deadline/test_worker.py +++ b/test/unit/deadline/test_worker.py @@ -367,7 +367,7 @@ def test_get_worker_id(self, worker_id: str, worker: PosixInstanceWorker) -> Non worker, "send_command", return_value=CommandResult(exit_code=0, stdout=worker_id) ): # WHEN - result = worker.worker_id() + result = worker.worker_id # THEN assert result == worker_id.rstrip("\n\r")