Skip to content

Commit 0ba084b

Browse files
test(integration): inline fresh run_id setup and remove payload helper
1 parent 72fbed1 commit 0ba084b

4 files changed

Lines changed: 8 additions & 64 deletions

File tree

tests/integration/campaign_payload_utils.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

tests/integration/test_event_campaign_e2e.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
import asyncio
66
import json
7+
import uuid
78
from typing import Any
89

910
import httpx
1011
import pytest
1112
import websockets
1213

13-
from tests.integration.campaign_payload_utils import campaign_with_fresh_ids
1414
from tests.integration.conftest import (
1515
get_api_key,
1616
get_orchestrator_url,
@@ -29,7 +29,8 @@ async def test_event_campaign_completes_via_websocket(
2929
base_url = get_orchestrator_url()
3030
ws_url = get_orchestrator_ws_url()
3131
api_key = get_api_key()
32-
campaign_data = campaign_with_fresh_ids(event_campaign_json)
32+
campaign_data = json.loads(json.dumps(event_campaign_json))
33+
campaign_data['run_id'] = str(uuid.uuid4())
3334

3435
received_events: list[dict[str, Any]] = []
3536
campaign_complete = False

tests/integration/test_full_loop_e2e.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import pytest
2020
import websockets
2121

22-
from tests.integration.campaign_payload_utils import campaign_with_fresh_ids
2322
from tests.integration.conftest import (
2423
get_api_key,
2524
get_orchestrator_url,
@@ -44,8 +43,7 @@ async def test_full_campaign_loop_with_websocket(
4443
base_url = get_orchestrator_url()
4544
ws_url = get_orchestrator_ws_url()
4645
api_key = get_api_key()
47-
campaign_data = campaign_with_fresh_ids(load_campaign_json())
48-
# avoid 409 conflicts by changing the run ID out
46+
campaign_data = json.loads(json.dumps(load_campaign_json()))
4947
campaign_data['run_id'] = str(uuid.uuid4())
5048

5149
# Track received events

tests/integration/test_iterative_campaign_e2e.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
)
2626
from intersect_orchestrator.app.core.campaign_orchestrator import CampaignOrchestrator
2727
from intersect_orchestrator.app.core.repository import InMemoryCampaignRepository
28-
from tests.integration.campaign_payload_utils import campaign_with_fresh_ids
2928

3029
if TYPE_CHECKING:
3130
import pathlib
@@ -46,7 +45,8 @@ def test_submit_iterative_campaign_creates_state(
4645
iterative_campaign_json: dict,
4746
) -> None:
4847
"""Submitting the iterative campaign should create state, Petri net, and initial events."""
49-
campaign_data = campaign_with_fresh_ids(iterative_campaign_json)
48+
campaign_data = json.loads(json.dumps(iterative_campaign_json))
49+
campaign_data['run_id'] = str(uuid.uuid4())
5050
campaign = Campaign(**campaign_data)
5151

5252
repository = InMemoryCampaignRepository()
@@ -90,7 +90,8 @@ def test_iterative_campaign_completes_all_iterations(
9090
* ``RANDOM_NUMBER_SERVICE_AVAILABLE`` is not set (service not present), or
9191
* a competing orchestrator service is subscribed to the same queue.
9292
"""
93-
campaign_data = campaign_with_fresh_ids(iterative_campaign_json)
93+
campaign_data = json.loads(json.dumps(iterative_campaign_json))
94+
campaign_data['run_id'] = str(uuid.uuid4())
9495
campaign = Campaign(**campaign_data)
9596

9697
repository = InMemoryCampaignRepository()

0 commit comments

Comments
 (0)