From 43a2546bc57e20d884fce26e5021d25c74a5670a Mon Sep 17 00:00:00 2001 From: Sebastian Morawiec Date: Thu, 23 May 2024 14:44:20 +0200 Subject: [PATCH] fix tests --- projects/orquestra-sdk/docs/examples/tests/test_secrets.py | 2 +- .../orquestra-sdk/tests/runtime/ray/test_build_workflow.py | 6 +++--- projects/orquestra-sdk/tests/sdk/api/test_task_run.py | 4 ++-- projects/orquestra-sdk/tests/sdk/secrets/test_api.py | 2 +- projects/orquestra-sdk/tests/sdk/secrets/test_auth.py | 2 +- projects/orquestra-sdk/tests/sdk/secrets/test_client.py | 4 ++-- projects/orquestra-sdk/tests/sdk/test_in_process_runtime.py | 2 +- projects/orquestra-sdk/tests/sdk/test_traversal.py | 3 +-- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/projects/orquestra-sdk/docs/examples/tests/test_secrets.py b/projects/orquestra-sdk/docs/examples/tests/test_secrets.py index 8981555d6..e64a6451f 100644 --- a/projects/orquestra-sdk/docs/examples/tests/test_secrets.py +++ b/projects/orquestra-sdk/docs/examples/tests/test_secrets.py @@ -16,12 +16,12 @@ from unittest.mock import Mock +import orquestra.workflow_shared.secrets._client import pytest import responses from orquestra.workflow_shared.schema import configs import orquestra.sdk._client._base._config -import orquestra.sdk._client.secrets._client class Snippets: diff --git a/projects/orquestra-sdk/tests/runtime/ray/test_build_workflow.py b/projects/orquestra-sdk/tests/runtime/ray/test_build_workflow.py index 2c1838739..e87b4233b 100644 --- a/projects/orquestra-sdk/tests/runtime/ray/test_build_workflow.py +++ b/projects/orquestra-sdk/tests/runtime/ray/test_build_workflow.py @@ -6,7 +6,7 @@ from typing import Any, Dict, List, Optional, Union from unittest.mock import ANY, Mock, call, create_autospec -import orquestra.workflow_runtime.secrets +import orquestra.workflow_shared.secrets import pytest from orquestra.workflow_runtime._ray import _build_workflow, _client from orquestra.workflow_shared import parse_git_url, serde @@ -90,9 +90,9 @@ def test_uses_default_protocol(self, git_url: GitURL): assert url == "https://github.com/zapata-engineering/orquestra-sdk" def test_with_password(self, monkeypatch: pytest.MonkeyPatch, git_url: GitURL): - secrets_get = create_autospec(orquestra.workflow_runtime.secrets.get) + secrets_get = create_autospec(orquestra.workflow_shared.secrets.get) secrets_get.return_value = "" - monkeypatch.setattr(orquestra.workflow_runtime.secrets, "get", secrets_get) + monkeypatch.setattr(orquestra.workflow_shared.secrets, "get", secrets_get) secret_name = "my_secret" secret_config = "secret config" diff --git a/projects/orquestra-sdk/tests/sdk/api/test_task_run.py b/projects/orquestra-sdk/tests/sdk/api/test_task_run.py index 901d6c7f6..fe6ae63f9 100644 --- a/projects/orquestra-sdk/tests/sdk/api/test_task_run.py +++ b/projects/orquestra-sdk/tests/sdk/api/test_task_run.py @@ -8,8 +8,8 @@ import typing as t from unittest.mock import Mock, create_autospec +import orquestra.workflow_runtime import pytest -from orquestra.workflow_runtime._ray import _build_workflow from orquestra.workflow_shared import serde from orquestra.workflow_shared.abc import RuntimeInterface from orquestra.workflow_shared.exceptions import TaskRunNotFound @@ -542,7 +542,7 @@ def mock_ray_context(monkeypatch): task_inv_id = "inv-1-generate-data" task_run_id = f"{wf_run_id}@{task_inv_id}" monkeypatch.setattr( - _build_workflow, + orquestra.workflow_runtime, "get_current_ids", Mock(return_value=(wf_run_id, task_inv_id, task_run_id)), ) diff --git a/projects/orquestra-sdk/tests/sdk/secrets/test_api.py b/projects/orquestra-sdk/tests/sdk/secrets/test_api.py index eedce89ca..863f7d60e 100644 --- a/projects/orquestra-sdk/tests/sdk/secrets/test_api.py +++ b/projects/orquestra-sdk/tests/sdk/secrets/test_api.py @@ -9,8 +9,8 @@ from unittest.mock import Mock import pytest -from orquestra.workflow_runtime.secrets import _auth, _exceptions, _models from orquestra.workflow_shared import exceptions as sdk_exc +from orquestra.workflow_shared.secrets import _auth, _exceptions, _models from orquestra import sdk diff --git a/projects/orquestra-sdk/tests/sdk/secrets/test_auth.py b/projects/orquestra-sdk/tests/sdk/secrets/test_auth.py index 49fe08374..a4300e6b8 100644 --- a/projects/orquestra-sdk/tests/sdk/secrets/test_auth.py +++ b/projects/orquestra-sdk/tests/sdk/secrets/test_auth.py @@ -9,9 +9,9 @@ from pathlib import Path import pytest -from orquestra.workflow_runtime.secrets import _auth from orquestra.workflow_shared import exceptions from orquestra.workflow_shared.schema import configs +from orquestra.workflow_shared.secrets import _auth class TestAuthorizedClient: diff --git a/projects/orquestra-sdk/tests/sdk/secrets/test_client.py b/projects/orquestra-sdk/tests/sdk/secrets/test_client.py index 213a3dc1b..8bc00e0b5 100644 --- a/projects/orquestra-sdk/tests/sdk/secrets/test_client.py +++ b/projects/orquestra-sdk/tests/sdk/secrets/test_client.py @@ -8,8 +8,8 @@ """ import pytest import responses -from orquestra.workflow_runtime.secrets import _exceptions, _models -from orquestra.workflow_runtime.secrets._client import SecretsClient +from orquestra.workflow_shared.secrets import _exceptions, _models +from orquestra.workflow_shared.secrets._client import SecretsClient from . import resp_mocks diff --git a/projects/orquestra-sdk/tests/sdk/test_in_process_runtime.py b/projects/orquestra-sdk/tests/sdk/test_in_process_runtime.py index d61b3deab..4e6ac11dd 100644 --- a/projects/orquestra-sdk/tests/sdk/test_in_process_runtime.py +++ b/projects/orquestra-sdk/tests/sdk/test_in_process_runtime.py @@ -12,12 +12,12 @@ from unittest.mock import create_autospec import pytest -from orquestra.workflow_runtime.secrets import _client, _models from orquestra.workflow_shared import exceptions, serde from orquestra.workflow_shared._spaces._structs import ProjectRef from orquestra.workflow_shared.dates import _dates from orquestra.workflow_shared.schema import ir from orquestra.workflow_shared.schema.workflow_run import State, WorkflowRunId +from orquestra.workflow_shared.secrets import _client, _models from orquestra import sdk from orquestra.sdk._client._base._in_process_runtime import InProcessRuntime diff --git a/projects/orquestra-sdk/tests/sdk/test_traversal.py b/projects/orquestra-sdk/tests/sdk/test_traversal.py index c63cf1d38..fc57545dc 100644 --- a/projects/orquestra-sdk/tests/sdk/test_traversal.py +++ b/projects/orquestra-sdk/tests/sdk/test_traversal.py @@ -15,8 +15,7 @@ import orquestra.workflow_shared.schema.ir as ir import pytest from git.remote import Remote -from orquestra.workflow_runtime import secrets -from orquestra.workflow_shared import dispatch, exceptions, serde +from orquestra.workflow_shared import dispatch, exceptions, secrets, serde from orquestra.workflow_shared.packaging import _versions from orquestra.sdk._client._base import _dsl, _traversal, _workflow