Skip to content

Commit ba95ac2

Browse files
committed
fix: make sure mutable test apps don't clash
The mock server is stateful and with multiple tests running either after another (was getting issues with hello world being deployed when it shouldn't have been), and also with parallel workers, I think it's better we scope each test with their own unique hello_world app name. `test_app` remains non-unique - it needs to be expected to be there (I guess I could put it in the context, but it doesn't need to be yet so 🤷). Other alternative was resetting the mock DB but I figured that might lead to race conditions and it was better if this stuff was just as idempotent as possible
1 parent 22ed365 commit ba95ac2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/integration/features/steps/mcp_steps.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,13 @@ async def call_mcp_tool(context, tool_name, arguments=None):
5353

5454
def create_towerfile(app_type="hello_world"):
5555
"""Create a Towerfile for testing - pure function with no side effects beyond file creation"""
56+
import uuid
57+
58+
# Add unique suffix to avoid test interference
59+
unique_suffix = str(uuid.uuid4())[:8]
60+
5661
configs = {
57-
"hello_world": ("hello-world", "hello.py", "Simple hello world app"),
62+
"hello_world": (f"hello-world-{unique_suffix}", "hello.py", "Simple hello world app"),
5863
"test_app": ("test-app", "hello.py", "Pre-existing test app for CLI tests"),
5964
}
6065

0 commit comments

Comments
 (0)