Skip to content

Commit

Permalink
removed tests of the cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Dec 2, 2024
1 parent 78d9c73 commit 8de418d
Showing 1 changed file with 0 additions and 80 deletions.
80 changes: 0 additions & 80 deletions services/web/server/tests/unit/with_dbs/01/test_director_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
import pytest
from aioresponses import aioresponses
from faker import Faker
from hypothesis import HealthCheck, given, settings
from hypothesis import strategies as st
from models_library.api_schemas_webserver.clusters import (
ClusterCreate,
ClusterPatch,
ClusterPing,
)
from models_library.clusters import ClusterID
from models_library.projects import ProjectID
from models_library.projects_pipeline import ComputationTask
from models_library.projects_state import RunningState
Expand All @@ -38,11 +30,6 @@ def project_id(faker: Faker) -> ProjectID:
return ProjectID(faker.uuid4())


@pytest.fixture
def cluster_id(faker: Faker) -> ClusterID:
return ClusterID(faker.pyint(min_value=0))


async def test_create_pipeline(
mocked_director_v2,
client,
Expand Down Expand Up @@ -74,70 +61,3 @@ async def test_delete_pipeline(
mocked_director_v2, client, user_id: UserID, project_id: ProjectID
):
await api.delete_pipeline(client.app, user_id, project_id)


@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
@given(cluster_create=st.builds(ClusterCreate))
async def test_create_cluster(
mocked_director_v2, client, user_id: UserID, cluster_create
):
created_cluster = await api.create_cluster(
client.app, user_id=user_id, new_cluster=cluster_create
)
assert created_cluster is not None
assert isinstance(created_cluster, dict)
assert "id" in created_cluster


async def test_list_clusters(mocked_director_v2, client, user_id: UserID):
list_of_clusters = await api.list_clusters(client.app, user_id=user_id)
assert isinstance(list_of_clusters, list)
assert len(list_of_clusters) > 0


async def test_get_cluster(
mocked_director_v2, client, user_id: UserID, cluster_id: ClusterID
):
cluster = await api.get_cluster(client.app, user_id=user_id, cluster_id=cluster_id)
assert isinstance(cluster, dict)
assert cluster["id"] == cluster_id


async def test_get_cluster_details(
mocked_director_v2, client, user_id: UserID, cluster_id: ClusterID
):
cluster_details = await api.get_cluster_details(
client.app, user_id=user_id, cluster_id=cluster_id
)
assert isinstance(cluster_details, dict)


@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
@given(cluster_patch=st.from_type(ClusterPatch))
async def test_update_cluster(
mocked_director_v2, client, user_id: UserID, cluster_id: ClusterID, cluster_patch
):
print(f"--> updating cluster with {cluster_patch=}")
updated_cluster = await api.update_cluster(
client.app, user_id=user_id, cluster_id=cluster_id, cluster_patch=cluster_patch
)
assert isinstance(updated_cluster, dict)
assert updated_cluster["id"] == cluster_id


async def test_delete_cluster(
mocked_director_v2, client, user_id: UserID, cluster_id: ClusterID
):
await api.delete_cluster(client.app, user_id=user_id, cluster_id=cluster_id)


@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
@given(cluster_ping=st.builds(ClusterPing))
async def test_ping_cluster(mocked_director_v2, client, cluster_ping: ClusterPing):
await api.ping_cluster(client.app, cluster_ping=cluster_ping)


async def test_ping_specific_cluster(
mocked_director_v2, client, user_id: UserID, cluster_id: ClusterID
):
await api.ping_specific_cluster(client.app, user_id=user_id, cluster_id=cluster_id)

0 comments on commit 8de418d

Please sign in to comment.