Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 5c059c8

Browse files
update changes related to field change in integration tests
1 parent 8545f21 commit 5c059c8

File tree

3 files changed

+39
-35
lines changed

3 files changed

+39
-35
lines changed

tests/integration/test_extensions_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def test_extension_echo(
5252
"var7": "string2",
5353
},
5454
)
55-
task_info = await _update_task_info(str(result.task_id), wait=True)
55+
task_info = await _update_task_info(str(result.uuid), wait=True)
5656
assert task_info.status == "SUCCESS"
5757
assert task_info.result_code == 0
5858
assert (

tests/integration/test_graphql_tasks.py

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
resultCode
4141
stdErr
4242
stdOut
43-
taskId
43+
uuid
4444
taskStatus
4545
createdBy
4646
}
@@ -54,7 +54,7 @@
5454
actionName
5555
endedAt
5656
taskStatus
57-
taskId
57+
uuid
5858
stdOut
5959
stdErr
6060
resultCode
@@ -85,7 +85,7 @@
8585
tasks(limit: 100, offset: 0, filters: {actionName: $actionName}) {
8686
tasksData {
8787
taskStatus
88-
taskId
88+
uuid
8989
stdOut
9090
stdErr
9191
resultCode
@@ -119,7 +119,7 @@
119119
tasks(limit: 100, offset: 0, filters: {extensionName: $extensionName}) {
120120
tasksData {
121121
taskStatus
122-
taskId
122+
uuid
123123
stdOut
124124
stdErr
125125
resultCode
@@ -151,7 +151,7 @@
151151
tasks(limit: 100, offset: 0, filters: {username: $username}) {
152152
tasksData {
153153
taskStatus
154-
taskId
154+
uuid
155155
stdOut
156156
stdErr
157157
resultCode
@@ -184,7 +184,7 @@
184184
tasks(limit: 100, offset: 0, filters: {experiment: {type: $type, value: $value}}) {
185185
tasksData {
186186
taskStatus
187-
taskId
187+
uuid
188188
stdOut
189189
stdErr
190190
resultCode
@@ -261,7 +261,7 @@
261261
resultCode
262262
stdErr
263263
stdOut
264-
taskId
264+
uuid
265265
taskStatus
266266
createdBy
267267
}
@@ -277,7 +277,7 @@
277277
resultCode
278278
stdErr
279279
stdOut
280-
taskId
280+
uuid
281281
taskStatus
282282
createdBy
283283
parameters {
@@ -342,7 +342,7 @@ async def test_execute_extension(
342342
)
343343
assert resp.errors is None
344344
res = resp.data["executeExtension"]
345-
assert UUID(res["taskId"])
345+
assert UUID(res["uuid"])
346346
assert res["taskStatus"] in ("SUCCESS", "STARTED", "PENDING")
347347

348348

@@ -366,8 +366,7 @@ async def test_cancel_task(
366366
schema = Schema(query=Query, mutation=Mutation)
367367
context = ServerContext(
368368
db_session=db_session,
369-
user_info=UserInfo(
370-
uuid=db_user.uuid, username=db_user.username, scopes=set(UserScope)),
369+
user_info=UserInfo(uuid=db_user.uuid, username=db_user.username, scopes=set(UserScope)),
371370
)
372371
resp = await schema.execute(
373372
query=execute_extension_mutation,
@@ -387,7 +386,7 @@ async def test_cancel_task(
387386
},
388387
context_value=context,
389388
)
390-
taskId = UUID(resp.data["executeExtension"]["taskId"])
389+
taskId = UUID(resp.data["executeExtension"]["uuid"])
391390
assert isinstance(taskId, UUID)
392391
resp = await schema.execute(
393392
query=cancel_task_mutation,
@@ -396,7 +395,7 @@ async def test_cancel_task(
396395
)
397396

398397
res = resp.data["cancelTask"]
399-
assert UUID(res["taskId"])
398+
assert UUID(res["uuid"])
400399

401400
# TODO: if we don't wait, most probably this status
402401
# will be "PENDING", so after a cycle of waiting this will update
@@ -449,13 +448,13 @@ async def test_query_all_tasks(
449448
},
450449
context_value=context,
451450
)
452-
taskId = UUID(resp.data["executeExtension"]["taskId"])
451+
taskId = UUID(resp.data["executeExtension"]["uuid"])
453452
task_ids.append(taskId)
454453

455454
resp = await schema.execute(all_tasks_query, context_value=context)
456455

457456
assert resp.errors is None
458-
resp_task_ids = [UUID(task["taskId"]) for task in resp.data["tasks"]["tasksData"]]
457+
resp_task_ids = [UUID(task["uuid"]) for task in resp.data["tasks"]["tasksData"]]
459458
assert set(resp_task_ids) == set(task_ids)
460459

461460

@@ -504,7 +503,7 @@ async def test_query_all_tasks_filter_by_action_name(
504503
},
505504
context_value=context,
506505
)
507-
taskId = UUID(resp.data["executeExtension"]["taskId"])
506+
taskId = UUID(resp.data["executeExtension"]["uuid"])
508507
task_ids.append(taskId)
509508

510509
resp = await schema.execute(
@@ -514,7 +513,7 @@ async def test_query_all_tasks_filter_by_action_name(
514513
)
515514

516515
assert resp.errors is None
517-
resp_task_ids = [UUID(task["taskId"]) for task in resp.data["tasks"]["tasksData"]]
516+
resp_task_ids = [UUID(task["uuid"]) for task in resp.data["tasks"]["tasksData"]]
518517
assert set(resp_task_ids) == set(task_ids)
519518
users = [task["createdBy"] for task in resp.data["tasks"]["tasksData"]]
520519
assert set(users) == {db_user.username}
@@ -565,7 +564,7 @@ async def test_query_all_tasks_filter_by_extension_name(
565564
},
566565
context_value=context,
567566
)
568-
taskId = UUID(resp.data["executeExtension"]["taskId"])
567+
taskId = UUID(resp.data["executeExtension"]["uuid"])
569568
task_ids.append(taskId)
570569

571570
resp = await schema.execute(
@@ -575,7 +574,7 @@ async def test_query_all_tasks_filter_by_extension_name(
575574
)
576575

577576
assert resp.errors is None
578-
resp_task_ids = [UUID(task["taskId"]) for task in resp.data["tasks"]["tasksData"]]
577+
resp_task_ids = [UUID(task["uuid"]) for task in resp.data["tasks"]["tasksData"]]
579578
assert set(resp_task_ids) == set(task_ids)
580579

581580

@@ -608,13 +607,17 @@ async def test_query_all_tasks_filter_by_username(
608607
for idx in range(10):
609608
context = ServerContext(
610609
db_session=db_session,
611-
user_info=UserInfo(uuid=db_user0.uuid, username=db_user0.username, scopes=set(UserScope)),
610+
user_info=UserInfo(
611+
uuid=db_user0.uuid, username=db_user0.username, scopes=set(UserScope)
612+
),
612613
)
613614
if idx > 7:
614-
context = ServerContext(
615-
db_session=db_session,
616-
user_info=UserInfo(uuid=db_user1.uuid, username=db_user1.username, scopes=set(UserScope)),
617-
)
615+
context = ServerContext(
616+
db_session=db_session,
617+
user_info=UserInfo(
618+
uuid=db_user1.uuid, username=db_user1.username, scopes=set(UserScope)
619+
),
620+
)
618621
resp = await schema.execute(
619622
query=execute_extension_mutation,
620623
variable_values={
@@ -633,9 +636,9 @@ async def test_query_all_tasks_filter_by_username(
633636
},
634637
context_value=context,
635638
)
636-
taskId = UUID(resp.data["executeExtension"]["taskId"])
639+
taskId = UUID(resp.data["executeExtension"]["uuid"])
637640
if idx <= 7:
638-
task_ids.append(taskId)
641+
task_ids.append(taskId)
639642

640643
resp = await schema.execute(
641644
all_tasks_query_filter_by_username,
@@ -644,5 +647,5 @@ async def test_query_all_tasks_filter_by_username(
644647
)
645648

646649
assert resp.errors is None
647-
resp_task_ids = [UUID(task["taskId"]) for task in resp.data["tasks"]["tasksData"]]
650+
resp_task_ids = [UUID(task["uuid"]) for task in resp.data["tasks"]["tasksData"]]
648651
assert set(resp_task_ids) == set(task_ids)

tests/integration/test_job_scopes.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66

77
import pytest
88
import pytest_asyncio
9-
109
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
1110

12-
from aqueductcore.backend.errors import AQDPermission, AQDDBTaskNonExisting
1311
from aqueductcore.backend.context import UserInfo, UserScope
12+
from aqueductcore.backend.errors import AQDDBTaskNonExisting, AQDPermission
1413
from aqueductcore.backend.models import orm
1514
from aqueductcore.backend.models.experiment import ExperimentCreate
1615
from aqueductcore.backend.models.task import TaskCreate
1716
from aqueductcore.backend.services.task_executor import (
18-
get_all_tasks, get_task_by_uuid, revoke_task,
17+
get_all_tasks,
18+
get_task_by_uuid,
19+
revoke_task,
1920
)
2021
from aqueductcore.backend.services.utils import (
2122
experiment_model_to_orm,
@@ -171,7 +172,7 @@ async def test_user_can_see_a_task(
171172
),
172173
db_session=my_db_session,
173174
)
174-
assert task.task_id == str(task_id)
175+
assert task.uuid == str(task_id)
175176
else:
176177
with pytest.raises(AQDPermission):
177178
await get_task_by_uuid(
@@ -219,7 +220,7 @@ async def test_user_can_cancel_tasks(
219220
scopes=scope,
220221
),
221222
db_session=my_db_session,
222-
task_id=tasks_data[task_number].task_id,
223+
task_id=tasks_data[task_number].uuid,
223224
terminate=False,
224225
)
225226
else:
@@ -230,7 +231,7 @@ async def test_user_can_cancel_tasks(
230231
scopes=scope,
231232
),
232233
db_session=my_db_session,
233-
task_id=tasks_data[task_number].task_id,
234+
task_id=tasks_data[task_number].uuid,
234235
terminate=False,
235236
)
236-
assert task.task_id == tasks_data[task_number].task_id
237+
assert task.uuid == tasks_data[task_number].uuid

0 commit comments

Comments
 (0)