Skip to content

Commit d92173d

Browse files
committed
Disable order tests
1 parent e5e2aca commit d92173d

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

changelog/+nodes-order.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`client.all` and `client.filters` now support `order` parameter allowing to disable order of retrieve nodes in order to enhance performances

tests/integration/test_infrahub_client.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from infrahub_sdk.schema import ProfileSchemaAPI
1111
from infrahub_sdk.testing.docker import TestInfrahubDockerClient
1212
from infrahub_sdk.testing.schemas.animal import TESTING_ANIMAL, TESTING_CAT, TESTING_DOG, TESTING_PERSON, SchemaAnimal
13-
from infrahub_sdk.types import Order
1413

1514
if TYPE_CHECKING:
1615
from infrahub_sdk import InfrahubClient
@@ -62,17 +61,20 @@ async def test_get_all(self, client: InfrahubClient, base_dataset):
6261
assert isinstance(nodes[0], InfrahubNode)
6362
assert [node.name.value for node in nodes] == ["Bella", "Luna"]
6463

65-
async def test_get_all_no_order(self, client: InfrahubClient, base_dataset):
66-
nodes = await client.all(kind=TESTING_CAT, order=Order(disable=True))
67-
assert len(nodes) == 2
68-
assert isinstance(nodes[0], InfrahubNode)
69-
assert {node.name.value for node in nodes} == {"Bella", "Luna"}
70-
71-
async def test_get_filters_no_order(self, client: InfrahubClient, base_dataset):
72-
nodes = await client.filters(kind=TESTING_CAT, order=Order(disable=True))
73-
assert len(nodes) == 2
74-
assert isinstance(nodes[0], InfrahubNode)
75-
assert {node.name.value for node in nodes} == {"Bella", "Luna"}
64+
# TODO enable these tests for infrahub version containing this commit
65+
# https://github.com/opsmill/infrahub/commit/5a4d6860196b5bfb51fb8a124f33125f4a0b6753
66+
# when we support testing against multiple infrahub versions.
67+
# async def test_get_all_no_order(self, client: InfrahubClient, base_dataset):
68+
# nodes = await client.all(kind=TESTING_CAT, order=Order(disable=True))
69+
# assert len(nodes) == 2
70+
# assert isinstance(nodes[0], InfrahubNode)
71+
# assert {node.name.value for node in nodes} == {"Bella", "Luna"}
72+
#
73+
# async def test_get_filters_no_order(self, client: InfrahubClient, base_dataset):
74+
# nodes = await client.filters(kind=TESTING_CAT, order=Order(disable=True))
75+
# assert len(nodes) == 2
76+
# assert isinstance(nodes[0], InfrahubNode)
77+
# assert {node.name.value for node in nodes} == {"Bella", "Luna"}
7678

7779
async def test_get_one(self, client: InfrahubClient, base_dataset, cat_luna, person_sophia):
7880
node1 = await client.get(kind=TESTING_CAT, id=cat_luna.id)

0 commit comments

Comments
 (0)