Skip to content

Commit

Permalink
test(snapshot): reserved word and tip tracking bug (#15197)
Browse files Browse the repository at this point in the history
## 7.3.0 Final Snapshot additions
  • Loading branch information
y3rsh authored Jun 5, 2024
1 parent d3d53bf commit 3643682
Show file tree
Hide file tree
Showing 10 changed files with 3,303 additions and 85 deletions.
16 changes: 16 additions & 0 deletions app-testing/automation/data/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,22 @@ class Protocols:
robot_error=True,
)

Flex_S_v2_18_P1000_96_TipTrackingBug: Protocol = Protocol(
file_stem="Flex_S_v2_18_P1000_96_TipTrackingBug",
file_extension="py",
robot="Flex",
app_error=False,
robot_error=False,
)

Flex_X_v2_18_NO_PIPETTES_ReservedWord: Protocol = Protocol(
file_stem="Flex_X_v2_18_NO_PIPETTES_ReservedWord",
file_extension="py",
robot="Flex",
app_error=True,
robot_error=True,
)

OT2_X_v2_18_None_None_duplicateRTPVariableName: Protocol = Protocol(
file_stem="OT2_X_v2_18_None_None_duplicateRTPVariableName",
file_extension="py",
Expand Down
2 changes: 2 additions & 0 deletions app-testing/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Flex_S_v2_16_P1000_96_TC_PartialTipPickupColumn,
Flex_S_v2_16_P1000_96_TC_PartialTipPickupSingle,
Flex_S_v2_17_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots,
Flex_S_v2_18_NO_PIPETTES_GoldenRTP,
Flex_S_v2_18_P1000_96_TipTrackingBug,
Flex_X_v2_16_NO_PIPETTES_AccessToFixedTrashProp,
Flex_X_v2_16_NO_PIPETTES_MM_MagneticModuleInFlexProtocol,
Flex_X_v2_16_NO_PIPETTES_TC_TrashBinAndThermocyclerConflict,
Expand All @@ -58,6 +59,7 @@ Flex_X_v2_16_P1000_96_TC_pipetteCollisionWithThermocyclerLidClips,
Flex_X_v2_16_P1000_96_TM_ModuleAndWasteChuteConflict,
Flex_X_v2_16_P300MGen2_None_OT2PipetteInFlexProtocol,
Flex_X_v2_18_NO_PIPETTES_DescriptionTooLongRTP,
Flex_X_v2_18_NO_PIPETTES_ReservedWord,
Flex_X_v8_P1000_96_HS_GRIP_TC_TM_GripperCollisionWithTips,
OT2_S_v2_11_P10S_P300M_MM_TC1_TM_Swift,
OT2_S_v2_12_NO_PIPETTES_Python310SyntaxRobotAnalysisOnlyError,
Expand Down
59 changes: 0 additions & 59 deletions app-testing/files/examples/description_too_long_2.18.py

This file was deleted.

24 changes: 0 additions & 24 deletions app-testing/files/examples/invalid_properties_2.18.py

This file was deleted.

32 changes: 32 additions & 0 deletions app-testing/files/protocols/Flex_S_v2_18_NO_PIPETTES_GoldenRTP.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,38 @@ def add_parameters(parameters):
)


def ensure_type(value, expected_type):
if not isinstance(value, expected_type):
raise TypeError(f"Expected type {expected_type.__name__}, got {type(value).__name__}")


def run(context):
for variable_name, value in context.params.get_all().items():
context.comment(f"variable {variable_name} has value {value}")

# Int parameters
ensure_type(context.params.min_max_all_fields, int)
ensure_type(context.params.int_min_max_without_unit, int)
ensure_type(context.params.int_min_max_without_description, int)
ensure_type(context.params.int_min_max_without_unit_and_description, int)
ensure_type(context.params.int_choices_all_fields, int)
ensure_type(context.params.int_choice_no_unit, int)
ensure_type(context.params.int_choice_no_unit_desc, int)

# Float parameters
ensure_type(context.params.float_min_max_all_fields, float)
ensure_type(context.params.float_min_max_no_unit, float)
ensure_type(context.params.float_min_max_no_unit_or_desc, float)
ensure_type(context.params.float_choices_all_fields, float)
ensure_type(context.params.float_choices_no_unit, float)
ensure_type(context.params.float_choices_no_description, float)
ensure_type(context.params.float_choices_no_unit_or_desc, float)

# Boolean parameters
ensure_type(context.params.bool_all_fields, bool)
ensure_type(context.params.bool_no_desc, bool)

# String parameters
ensure_type(context.params.str_choices_all_fields, str)
ensure_type(context.params.str_choices_all_many_fields, str)
ensure_type(context.params.str_choices_no_desc, str)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from opentrons import protocol_api
from opentrons.protocol_api import COLUMN, ALL

requirements = {
"robotType": "Flex",
"apiLevel": "2.18",
}


def run(ctx: protocol_api.ProtocolContext):

tiprack1000_1 = ctx.load_labware("opentrons_flex_96_tiprack_1000ul", "B2")
tiprack1000_2 = ctx.load_labware("opentrons_flex_96_tiprack_1000ul", "C2")

pipette = ctx.load_instrument("flex_96channel_1000", mount="left", tip_racks=[tiprack1000_1, tiprack1000_2])

trashA3 = ctx.load_trash_bin("A3")

pipette.configure_nozzle_layout(style=COLUMN, start="A12", tip_racks=[tiprack1000_1, tiprack1000_2])

# pickup and drop all 12 columns of the first tiprack and the first column of the second tiprack using Column A12 of the pipette (Should progress across the tiprack left to right)
for x in range(13):
pipette.pick_up_tip()
pipette.drop_tip()

pipette.configure_nozzle_layout(style=COLUMN, start="A1", tip_racks=[tiprack1000_1, tiprack1000_2])
# pickup and drop the remaining 11 columns of the second tiprack using column A1 of the pipette (should progress right to left)
for x in range(11):
pipette.pick_up_tip()
pipette.drop_tip()
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
from dataclasses import dataclass, fields
from typing import Union
from typing import List, Type, Union

from typing import Union, Type, List

metadata = {
"protocolName": "Default not in range",
}

requirements = {"robotType": "Flex", "apiLevel": "2.18"}


def add_parameters(parameters):
parameters.add_int(
display_name="int min/max all",
variable_name="def",
default=6,
minimum=1,
maximum=12,
description="description text",
unit="μl",
)


def run(context):
for variable_name, value in context.params.get_all().items():
context.comment(f"variable {variable_name} has value {value}")


def not_my_type(the_type: Type) -> List[Union[str, float, int, bool, dict, list, tuple, set, frozenset]]:
Expand All @@ -28,6 +50,9 @@ def not_my_type(the_type: Type) -> List[Union[str, float, int, bool, dict, list,
return [value for value in locals().values() if not isinstance(value, the_type)]


# Other examples


@dataclass
class ErrorVariableNames:
dunder: str = "__dunder"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,38 @@ def add_parameters(parameters):
)


def ensure_type(value, expected_type):
if not isinstance(value, expected_type):
raise TypeError(f"Expected type {expected_type.__name__}, got {type(value).__name__}")


def run(context):
for variable_name, value in context.params.get_all().items():
context.comment(f"variable {variable_name} has value {value}")

# Int parameters
ensure_type(context.params.min_max_all_fields, int)
ensure_type(context.params.int_min_max_without_unit, int)
ensure_type(context.params.int_min_max_without_description, int)
ensure_type(context.params.int_min_max_without_unit_and_description, int)
ensure_type(context.params.int_choices_all_fields, int)
ensure_type(context.params.int_choice_no_unit, int)
ensure_type(context.params.int_choice_no_unit_desc, int)

# Float parameters
ensure_type(context.params.float_min_max_all_fields, float)
ensure_type(context.params.float_min_max_no_unit, float)
ensure_type(context.params.float_min_max_no_unit_or_desc, float)
ensure_type(context.params.float_choices_all_fields, float)
ensure_type(context.params.float_choices_no_unit, float)
ensure_type(context.params.float_choices_no_description, float)
ensure_type(context.params.float_choices_no_unit_or_desc, float)

# Boolean parameters
ensure_type(context.params.bool_all_fields, bool)
ensure_type(context.params.bool_no_desc, bool)

# String parameters
ensure_type(context.params.str_choices_all_fields, str)
ensure_type(context.params.str_choices_all_many_fields, str)
ensure_type(context.params.str_choices_no_desc, str)
Loading

0 comments on commit 3643682

Please sign in to comment.