-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): skip command key hash generation only if command intent is …
…SETUP (#15020) Fixes RQA-2640 # Overview In a previous PR we made a change from skipping hash generation if `CommandCreate.intent == CommandIntent.SETUP` to if `CommandCreate.intent != CommandIntent.PROTOCOL`. But a command can have a null intent when it is a protocol command; we only expect setup commands to have an explicit SETUP intent. So we were accidentally skipping key hash generation for python protocols, which was resulting in the app not being able to match run commands with their analysis counterparts. This PR fixes that and also adds an integration test so we don't accidentally break this functionality again. # Review requests - want to make sure that there wasn't an important reason for making the original change that I'm missing. But since all tests are still passing I'm guessing there wasn't any functional change that required a change in the original `if` statement. # Risk assessment Low. Bug fix.
- Loading branch information
1 parent
f913db2
commit fd0f188
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 |