Skip to content

Commit 1fbd5f7

Browse files
Sankalp-MittalIsaac
andcommitted
acceptance: make genie change-serialized-space test cloud-safe
The real Genie API rejects the fixture's text_instruction.id 'ti-001' ("Expected lowercase 32-hex UUID without hyphens"), so the Cloud=true run failed in every workspace while the local testserver accepted it. Use a valid 32-hex id (no long digit run so [NUMID] doesn't rewrite it in the golden). On cloud the SDK retries the create, recording a duplicate consecutive POST; collapse it with print_requests.py --unique so the request assertion is stable. Verified against a real workspace via deco (aws-cli). Co-authored-by: Isaac <[email protected]>
1 parent 5a547a5 commit 1fbd5f7

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎acceptance/bundle/resources/genie_spaces/change-serialized-space/output.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Updated genie_spaces.my_space
2121
Files: 1 uploaded, 0 deleted
2222
Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
2323

24-
>>> print_requests.py //api/2.0/genie/spaces
24+
>>> print_requests.py //api/2.0/genie/spaces --unique
2525
{
2626
"method": "POST",
2727
"path": "/api/2.0/genie/spaces",
2828
"body": {
2929
"parent_path": "/Workspace/Users/[USERNAME]/.bundle/change-serialized-space-[UNIQUE_NAME]/default/resources",
30-
"serialized_space": "{\"version\":1,\"instructions\":{\"text_instructions\":[{\"id\":\"ti-001\",\"content\":[\"Analyze sales orders by date\"]}]}}\n",
30+
"serialized_space": "{\"version\":1,\"instructions\":{\"text_instructions\":[{\"id\":\"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\",\"content\":[\"Analyze sales orders by date\"]}]}}\n",
3131
"title": "test genie space",
3232
"warehouse_id": "[TEST_DEFAULT_WAREHOUSE_ID]"
3333
}
@@ -37,7 +37,7 @@ Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
3737
"path": "/api/2.0/genie/spaces/[MY_SPACE_ID]",
3838
"body": {
3939
"parent_path": "/Workspace/Users/[USERNAME]/.bundle/change-serialized-space-[UNIQUE_NAME]/default/resources",
40-
"serialized_space": "{\"version\":1,\"instructions\":{\"text_instructions\":[{\"id\":\"ti-001\",\"content\":[\"Summarize sales revenue by month\"]}]}}\n",
40+
"serialized_space": "{\"version\":1,\"instructions\":{\"text_instructions\":[{\"id\":\"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\",\"content\":[\"Summarize sales revenue by month\"]}]}}\n",
4141
"title": "test genie space",
4242
"warehouse_id": "[TEST_DEFAULT_WAREHOUSE_ID]"
4343
}

‎acceptance/bundle/resources/genie_spaces/change-serialized-space/script‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ trace $CLI bundle deploy
3333
print_state.py | gron.py | grep serialized_space > out.state_after_update.txt
3434

3535
# The full serialized_space content reached the create (POST) and update (PATCH) APIs.
36-
trace print_requests.py //api/2.0/genie/spaces
36+
# --unique collapses the duplicate create the SDK retries on cloud (eventual consistency).
37+
trace print_requests.py //api/2.0/genie/spaces --unique
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":1,"instructions":{"text_instructions":[{"id":"ti-001","content":["Analyze sales orders by date"]}]}}
1+
{"version":1,"instructions":{"text_instructions":[{"id":"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4","content":["Analyze sales orders by date"]}]}}

0 commit comments

Comments
 (0)