44
55import pytest
66import sqlalchemy as sa
7+ from faker import Faker
78from simcore_postgres_database .models .comp_runs import comp_runs
89from simcore_postgres_database .utils_comp_runs import get_latest_run_id_for_project
910from sqlalchemy .ext .asyncio import AsyncEngine
1011
1112
1213@pytest .fixture
13- async def sample_comp_runs (asyncpg_engine : AsyncEngine ):
14+ async def sample_comp_runs (asyncpg_engine : AsyncEngine , faker : Faker ):
1415 async with asyncpg_engine .begin () as conn :
1516 await conn .execute (sa .text ("SET session_replication_role = replica;" ))
1617 await conn .execute (sa .delete (comp_runs ))
@@ -37,6 +38,7 @@ async def sample_comp_runs(asyncpg_engine: AsyncEngine):
3738 "metadata" : None ,
3839 "use_on_demand_clusters" : False ,
3940 "dag_adjacency_list" : {},
41+ "collection_run_id" : faker .uuid4 (),
4042 },
4143 {
4244 "run_id" : 2 ,
@@ -58,6 +60,7 @@ async def sample_comp_runs(asyncpg_engine: AsyncEngine):
5860 "metadata" : None ,
5961 "use_on_demand_clusters" : False ,
6062 "dag_adjacency_list" : {},
63+ "collection_run_id" : faker .uuid4 (),
6164 },
6265 {
6366 "run_id" : 3 ,
@@ -79,6 +82,7 @@ async def sample_comp_runs(asyncpg_engine: AsyncEngine):
7982 "metadata" : None ,
8083 "use_on_demand_clusters" : False ,
8184 "dag_adjacency_list" : {},
85+ "collection_run_id" : faker .uuid4 (),
8286 },
8387 {
8488 "run_id" : 4 ,
@@ -100,6 +104,7 @@ async def sample_comp_runs(asyncpg_engine: AsyncEngine):
100104 "metadata" : None ,
101105 "use_on_demand_clusters" : False ,
102106 "dag_adjacency_list" : {},
107+ "collection_run_id" : faker .uuid4 (),
103108 },
104109 ],
105110 )
0 commit comments