Skip to content

Commit 641494d

Browse files
fix test
1 parent 895ca6c commit 641494d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

services/director-v2/tests/unit/with_dbs/comp_scheduler/test_api_route_computations.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
RutPricingPlanGet,
3434
RutPricingUnitGet,
3535
)
36+
from models_library.computations import CollectionRunID
3637
from models_library.projects import ProjectAtDB
3738
from models_library.projects_nodes import NodeID, NodeState
3839
from models_library.projects_pipeline import PipelineDetails
@@ -380,6 +381,7 @@ async def test_computation_create_validators(
380381
product_name: str,
381382
product_api_base_url: AnyHttpUrl,
382383
faker: Faker,
384+
faker_collection_run_id: CollectionRunID,
383385
):
384386
user = create_registered_user()
385387
proj = await project(user, workbench=fake_workbench_without_outputs)
@@ -389,13 +391,15 @@ async def test_computation_create_validators(
389391
product_name=product_name,
390392
product_api_base_url=product_api_base_url,
391393
use_on_demand_clusters=True,
394+
collection_run_id=faker_collection_run_id,
392395
)
393396
ComputationCreate(
394397
user_id=user["id"],
395398
project_id=proj.uuid,
396399
product_name=product_name,
397400
product_api_base_url=product_api_base_url,
398401
use_on_demand_clusters=False,
402+
collection_run_id=faker_collection_run_id,
399403
)
400404

401405

@@ -409,6 +413,7 @@ async def test_create_computation(
409413
create_registered_user: Callable[..., dict[str, Any]],
410414
project: Callable[..., Awaitable[ProjectAtDB]],
411415
async_client: httpx.AsyncClient,
416+
faker_collection_run_id: CollectionRunID,
412417
):
413418
user = create_registered_user()
414419
proj = await project(user, workbench=fake_workbench_without_outputs)
@@ -421,6 +426,7 @@ async def test_create_computation(
421426
project_id=proj.uuid,
422427
product_name=product_name,
423428
product_api_base_url=product_api_base_url,
429+
collection_run_id=faker_collection_run_id,
424430
)
425431
),
426432
)
@@ -516,6 +522,7 @@ async def test_create_computation_with_wallet(
516522
sqlalchemy_async_engine: AsyncEngine,
517523
fake_ec2_cpus: PositiveInt,
518524
fake_ec2_ram: ByteSize,
525+
faker_collection_run_id: CollectionRunID,
519526
):
520527
# In billable product a wallet is passed, with a selected pricing plan
521528
# the pricing plan contains information about the hardware that should be used
@@ -537,6 +544,7 @@ async def test_create_computation_with_wallet(
537544
product_name=product_name,
538545
product_api_base_url=product_api_base_url,
539546
wallet_info=wallet_info,
547+
collection_run_id=faker_collection_run_id,
540548
)
541549
),
542550
)
@@ -623,6 +631,7 @@ async def test_create_computation_with_wallet_with_invalid_pricing_unit_name_rai
623631
project: Callable[..., Awaitable[ProjectAtDB]],
624632
async_client: httpx.AsyncClient,
625633
wallet_info: WalletInfo,
634+
faker_collection_run_id: CollectionRunID,
626635
):
627636
user = create_registered_user()
628637
proj = await project(
@@ -639,6 +648,7 @@ async def test_create_computation_with_wallet_with_invalid_pricing_unit_name_rai
639648
product_name=product_name,
640649
product_api_base_url=product_api_base_url,
641650
wallet_info=wallet_info,
651+
collection_run_id=faker_collection_run_id,
642652
)
643653
),
644654
)
@@ -666,6 +676,7 @@ async def test_create_computation_with_wallet_with_no_clusters_keeper_raises_503
666676
project: Callable[..., Awaitable[ProjectAtDB]],
667677
async_client: httpx.AsyncClient,
668678
wallet_info: WalletInfo,
679+
faker_collection_run_id: CollectionRunID,
669680
):
670681
user = create_registered_user()
671682
proj = await project(user, workbench=fake_workbench_without_outputs)
@@ -679,6 +690,7 @@ async def test_create_computation_with_wallet_with_no_clusters_keeper_raises_503
679690
product_name=product_name,
680691
product_api_base_url=product_api_base_url,
681692
wallet_info=wallet_info,
693+
collection_run_id=faker_collection_run_id,
682694
)
683695
),
684696
)
@@ -719,6 +731,7 @@ async def test_start_computation(
719731
create_registered_user: Callable[..., dict[str, Any]],
720732
project: Callable[..., Awaitable[ProjectAtDB]],
721733
async_client: httpx.AsyncClient,
734+
faker_collection_run_id: CollectionRunID,
722735
):
723736
user = create_registered_user()
724737
proj = await project(user, workbench=fake_workbench_without_outputs)
@@ -732,6 +745,7 @@ async def test_start_computation(
732745
start_pipeline=True,
733746
product_name=product_name,
734747
product_api_base_url=product_api_base_url,
748+
collection_run_id=faker_collection_run_id,
735749
)
736750
),
737751
)
@@ -753,6 +767,7 @@ async def test_start_computation_with_project_node_resources_defined(
753767
create_registered_user: Callable[..., dict[str, Any]],
754768
project: Callable[..., Awaitable[ProjectAtDB]],
755769
async_client: httpx.AsyncClient,
770+
fake_collection_run_id: CollectionRunID,
756771
):
757772
user = create_registered_user()
758773
assert "json_schema_extra" in ServiceResourcesDictHelpers.model_config
@@ -781,6 +796,7 @@ async def test_start_computation_with_project_node_resources_defined(
781796
start_pipeline=True,
782797
product_name=product_name,
783798
product_api_base_url=product_api_base_url,
799+
collection_run_id=fake_collection_run_id,
784800
)
785801
),
786802
)
@@ -801,6 +817,7 @@ async def test_start_computation_with_deprecated_services_raises_406(
801817
create_registered_user: Callable[..., dict[str, Any]],
802818
project: Callable[..., Awaitable[ProjectAtDB]],
803819
async_client: httpx.AsyncClient,
820+
faker_collection_run_id: CollectionRunID,
804821
):
805822
user = create_registered_user()
806823
proj = await project(user, workbench=fake_workbench_without_outputs)
@@ -814,6 +831,7 @@ async def test_start_computation_with_deprecated_services_raises_406(
814831
start_pipeline=True,
815832
product_name=product_name,
816833
product_api_base_url=product_api_base_url,
834+
collection_run_id=faker_collection_run_id,
817835
)
818836
),
819837
)

0 commit comments

Comments
 (0)