-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): command intent and test (#15022)
## This is a copy of #15020
- Loading branch information
Showing
2 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
robot-server/tests/integration/http_api/test_command_key_hash_matching.tavern.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
test_name: Test that command keys in analysis and protocol run match for a deterministic protocol running using protocol engine | ||
|
||
marks: | ||
- usefixtures: | ||
- ot2_server_base_url | ||
|
||
stages: | ||
- name: Upload a protocol | ||
request: | ||
url: '{ot2_server_base_url}/protocols' | ||
method: POST | ||
files: | ||
files: 'tests/integration/protocols/basic_transfer_with_run_time_parameters.py' | ||
response: | ||
save: | ||
json: | ||
protocol_id: data.id | ||
analysis_id: data.analysisSummaries[0].id | ||
strict: | ||
- json:off | ||
status_code: 201 | ||
|
||
- name: Save command keys from protocol analysis | ||
max_retries: 5 | ||
delay_after: 1 | ||
request: | ||
url: '{ot2_server_base_url}/protocols/{protocol_id}/analyses/{analysis_id}' | ||
response: | ||
save: | ||
json: | ||
analysis_data: data | ||
home_cmd_key: data.commands[0].key | ||
plate_load_key: data.commands[1].key | ||
pipette_load_key: data.commands[3].key | ||
pick_up_tip_key: data.commands[4].key | ||
drop_tip_key: data.commands[7].key | ||
strict: | ||
- json:off | ||
json: | ||
data: | ||
id: '{analysis_id}' | ||
commands: | ||
- commandType: loadPipette | ||
|
||
- name: Create run from protocol | ||
request: | ||
url: '{ot2_server_base_url}/runs' | ||
method: POST | ||
json: | ||
data: | ||
protocolId: '{protocol_id}' | ||
response: | ||
status_code: 201 | ||
save: | ||
json: | ||
original_run_data: data | ||
run_id: data.id | ||
|
||
- name: Play the run | ||
request: | ||
url: '{ot2_server_base_url}/runs/{run_id}/actions' | ||
method: POST | ||
json: | ||
data: | ||
actionType: play | ||
response: | ||
status_code: 201 | ||
|
||
- name: Wait for the protocol to complete | ||
max_retries: 5 | ||
delay_after: 1 | ||
request: | ||
url: '{ot2_server_base_url}/runs/{run_id}' | ||
method: GET | ||
response: | ||
status_code: 200 | ||
strict: | ||
- json:off | ||
json: | ||
data: | ||
status: succeeded | ||
|
||
- name: Verify commands have keys identical to their counterparts in analysis | ||
request: | ||
url: '{ot2_server_base_url}/runs/{run_id}/commands' | ||
method: GET | ||
response: | ||
strict: | ||
- json:off | ||
status_code: 200 | ||
json: | ||
links: | ||
current: | ||
href: !anystr | ||
meta: | ||
runId: !anystr | ||
commandId: !anystr | ||
index: 7 | ||
key: !anystr | ||
createdAt: !anystr | ||
meta: | ||
cursor: 0 | ||
totalLength: 8 | ||
data: | ||
- id: !anystr | ||
key: '{home_cmd_key}' | ||
commandType: home | ||
- id: !anystr | ||
key: '{plate_load_key}' | ||
commandType: loadLabware | ||
- id: !anystr | ||
key: '{pipette_load_key}' | ||
commandType: loadPipette | ||
- id: !anystr | ||
key: '{pick_up_tip_key}' | ||
commandType: pickUpTip | ||
- id: !anystr | ||
key: '{drop_tip_key}' | ||
commandType: dropTip |