Skip to content

Commit

Permalink
fix(test): snapshot renaming (#15038)
Browse files Browse the repository at this point in the history
# Cleanup snapshots 

- Given the new protocol organization and naming
- delete all the snapshots of the old naming `find -type f ! \( -name
'*_S_*' -o -name '*_X_*' \) -exec rm {} +`
  - `make build-opentrons-analysis`  (default on edge)
  - ` make snapshot-test-update`
  - find old snapshots and delete
  • Loading branch information
y3rsh authored May 1, 2024
1 parent 65a5d0c commit 4eac5a2
Show file tree
Hide file tree
Showing 125 changed files with 10,009 additions and 15,605 deletions.
4 changes: 2 additions & 2 deletions app-testing/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.env
results
analysis_results/*.json
files/generated_protocols/*
!files/generated_protocols/.keepme
files/protocols/generated_protocols/*
!files/protocols/generated_protocols/.keepme
34 changes: 28 additions & 6 deletions app-testing/automation/data/protocol_registry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from pathlib import Path
from typing import Optional

from rich.console import Console
Expand Down Expand Up @@ -42,21 +43,42 @@ def all_defined_protocols_with_overrides(self) -> list[ProtocolWithOverrides]:
return [getattr(self.protocols_with_overrides, prop) for prop in dir(self.protocols_with_overrides) if "__" not in prop]


def all_stems() -> set[str]:
dir_path = Path(Path(__file__).resolve().parent.parent.parent, os.getenv("FILES_FOLDER", "files"), "protocols")
file_stems = {file.stem for file in dir_path.glob("*.py")}
return file_stems


def main() -> None:
console = Console()
protocol_registry = ProtocolRegistry()
console.print("protocols for APP_ANALYSIS_TEST_PROTOCOLS")
console.print(Panel('Formatted for .env APP_ANALYSIS_TEST_PROTOCOLS="'))
sorted_stems = sorted([p.file_stem for p in protocol_registry.all_defined_protocols()])
console.print(Panel("Formatted for .env"))
regular_stems = sorted([p.file_stem for p in protocol_registry.all_defined_protocols()])
console.print('APP_ANALYSIS_TEST_PROTOCOLS="')
console.print(",\n".join(sorted_stems))
console.print(",\n".join(regular_stems))
console.print('"')
console.print(Panel('Formatted for .env APP_ANALYSIS_TEST_PROTOCOLS_WITH_OVERRIDES="'))
override_stems = sorted([p.file_stem for p in protocol_registry.all_defined_protocols_with_overrides()])
console.print('APP_ANALYSIS_TEST_PROTOCOLS_WITH_OVERRIDES="')
sorted_stems = sorted([p.file_stem for p in protocol_registry.all_defined_protocols_with_overrides()])
console.print(",\n".join(sorted_stems))
console.print(",\n".join(override_stems))
console.print('"')

all_files = all_stems()
filtered_stems = {stem for stem in all_files if "overrides" not in stem.lower()}
found_override_stems = {stem for stem in all_files if "overrides" in stem.lower()}
# Finding and displaying differences
differences = filtered_stems - set(regular_stems)
if differences:
console.print(f"Stems in actual files not in mapping: {differences}")
else:
console.print("No differences between files and mapping.")

differences = found_override_stems - set(override_stems)
if differences:
console.print(f"Override Stems in actual files not in mapping: {differences}")
else:
console.print("No differences between actual override protocols and the mapping.")


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion app-testing/automation/data/protocol_with_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def create_protocols(self) -> None:
new_file_name = f"{new_file_stem}.{self.file_extension}"
# Create the full path for the new file
# all generated files live at files/protocols/$GENERATED_PROTOCOLS_FOLDER
new_file_path = Path(self.file_path.parent.parent, GENERATED_PROTOCOLS_FOLDER, new_file_name)
new_file_path = Path(self.file_path.parent, GENERATED_PROTOCOLS_FOLDER, new_file_name)
# Prepare the override string to prepend
override_string = f'{self.override_variable_name} = "{override}"\n'
# Write the new file with the override string prepended
Expand Down
49 changes: 16 additions & 33 deletions app-testing/automation/data/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ class Protocols:
robot_error=False,
)

OT2_S_v6_P20S_P300M_HS_HSCollision: Protocol = Protocol(
file_stem="OT2_S_v6_P20S_P300M_HS_HSCollision",
file_extension="json",
robot="OT2",
app_error=False,
robot_error=False,
description="""This protocol gives an error in PD.8-Channel pipette cannot access labware8-Channel pipettes cannot access labware or tip racks to the left or right of a Heater-Shaker GEN1 module. Move labware to a different slot to access it with an 8-Channel pipette.If you export it anyway there are NOT analysis errors in the app side analysis.TODO on if there are robot side analysis errors but do not expect them?""", # noqa: E501
)

OT2_S_v6_P20S_P300M_TransferReTransferLiquid: Protocol = Protocol(
file_stem="OT2_S_v6_P20S_P300M_TransferReTransferLiquid",
file_extension="json",
Expand Down Expand Up @@ -299,41 +290,41 @@ class Protocols:
robot_error=False,
)

OT2_X_v2_17_P300M_P20S_HS_TC_TM_dispense_changes: Protocol = Protocol(
file_stem="OT2_X_v2_17_P300M_P20S_HS_TC_TM_dispense_changes",
OT2_S_v2_17_P300M_P20S_HS_TC_TM_dispense_changes: Protocol = Protocol(
file_stem="OT2_S_v2_17_P300M_P20S_HS_TC_TM_dispense_changes",
file_extension="py",
robot="OT2",
app_error=True,
robot_error=False,
app_analysis_error="ValueError [line 15]: Cannot dispense more than pipette max volume", # noqa: E501
)

OT2_S_v2_14_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots: Protocol = Protocol(
file_stem="OT2_S_v2_14_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots",
OT2_S_v2_14_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots: Protocol = Protocol(
file_stem="OT2_S_v2_14_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots",
file_extension="py",
robot="OT2",
app_error=False,
robot_error=False,
)

OT2_S_v2_15_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots: Protocol = Protocol(
file_stem="OT2_S_v2_15_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots",
OT2_S_v2_15_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots: Protocol = Protocol(
file_stem="OT2_S_v2_15_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots",
file_extension="py",
robot="OT2",
app_error=False,
robot_error=False,
)

OT2_X_v2_16_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots: Protocol = Protocol(
file_stem="OT2_X_v2_16_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots",
OT2_S_v2_16_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots: Protocol = Protocol(
file_stem="OT2_S_v2_16_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots",
file_extension="py",
robot="OT2",
app_error=False,
robot_error=False,
)

OT2_S_v2_17_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots: Protocol = Protocol(
file_stem="OT2_S_v2_17_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots",
OT2_S_v2_17_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots: Protocol = Protocol(
file_stem="OT2_S_v2_17_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots",
file_extension="py",
robot="OT2",
app_error=False,
Expand Down Expand Up @@ -603,32 +594,24 @@ class Protocols:
robot_error=False,
)

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

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

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

Flex_S_v2_17_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots: Protocol = Protocol(
file_stem="Flex_S_v2_17_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots",
Flex_S_v2_17_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots: Protocol = Protocol(
file_stem="Flex_S_v2_17_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots",
file_extension="py",
robot="Flex",
app_error=False,
Expand Down
19 changes: 8 additions & 11 deletions app-testing/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ TARGET=edge
# dynamically generate with make print-protocols

APP_ANALYSIS_TEST_PROTOCOLS="
Flex_S_v2_14_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots,
Flex_S_v2_15_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots,
Flex_S_v2_15_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots,
Flex_S_v2_15_P1000M_P50M_GRIP_HS_MB_TC_TM_IlluminaDNAEnrichment,
Flex_S_v2_15_P1000M_P50M_GRIP_HS_MB_TC_TM_IlluminaDNAEnrichmentv4,
Flex_S_v2_15_P1000M_P50M_GRIP_HS_MB_TC_TM_IlluminaDNAPrep24x,
Expand All @@ -30,7 +29,7 @@ Flex_S_v2_15_P1000_96_GRIP_HS_MB_TM_MagMaxRNAExtraction,
Flex_S_v2_15_P1000_96_GRIP_HS_MB_TM_OmegaHDQDNAExtraction,
Flex_S_v2_15_P1000_96_GRIP_HS_TM_QuickZymoMagbeadRNAExtraction,
Flex_S_v2_15_P50M_P1000M_KAPALibraryQuantLongv2,
Flex_S_v2_16_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots,
Flex_S_v2_16_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots,
Flex_S_v2_16_P1000_96_GRIP_DeckConfiguration1NoModules,
Flex_S_v2_16_P1000_96_GRIP_DeckConfiguration1NoModulesNoFixtures,
Flex_S_v2_16_P1000_96_GRIP_HS_MB_TC_TM_DeckConfiguration1,
Expand All @@ -39,7 +38,7 @@ Flex_S_v2_16_P1000_96_GRIP_HS_MB_TC_TM_Smoke,
Flex_S_v2_16_P1000_96_GRIP_HS_MB_TC_TM_TriggerPrepareForMountMovement,
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_17_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots,
Flex_S_v2_18_NO_PIPETTES_GoldenRTP,
Flex_X_v2_16_NO_PIPETTES_AccessToFixedTrashProp,
Flex_X_v2_16_NO_PIPETTES_MM_MagneticModuleInFlexProtocol,
Expand All @@ -65,19 +64,21 @@ OT2_S_v2_12_NO_PIPETTES_Python310SyntaxRobotAnalysisOnlyError,
OT2_S_v2_12_P300M_P20S_FailOnRun,
OT2_S_v2_13_P300M_P20S_HS_TC_TM_SmokeTestV3,
OT2_S_v2_13_P300M_P20S_MM_TC_TM_Smoke620Release,
OT2_S_v2_14_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots,
OT2_S_v2_14_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots,
OT2_S_v2_14_P300M_P20S_HS_TC_TM_SmokeTestV3,
OT2_S_v2_15_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots,
OT2_S_v2_15_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots,
OT2_S_v2_15_P300M_P20S_HS_TC_TM_SmokeTestV3,
OT2_S_v2_15_P300M_P20S_HS_TC_TM_dispense_changes,
OT2_S_v2_16_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots,
OT2_S_v2_16_NO_PIPETTES_verifyDoesNotDeadlock,
OT2_S_v2_16_P300M_P20S_HS_TC_TM_SmokeTestV3,
OT2_S_v2_16_P300M_P20S_HS_TC_TM_aspirateDispenseMix0Volume,
OT2_S_v2_16_P300M_P20S_HS_TC_TM_dispense_changes,
OT2_S_v2_16_P300M_P20S_aspirateDispenseMix0Volume,
OT2_S_v2_16_P300S_None_verifyNoFloatingPointErrorInPipetting,
OT2_S_v2_17_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots,
OT2_S_v2_17_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots,
OT2_S_v2_17_P300M_P20S_HS_TC_TM_SmokeTestV3,
OT2_S_v2_17_P300M_P20S_HS_TC_TM_dispense_changes,
OT2_S_v2_18_NO_PIPETTES_GoldenRTP_OT2,
OT2_S_v2_18_None_None_duplicateChoiceValue,
OT2_S_v2_2_P300S_None_MM1_MM2_EngageMagHeightFromBase,
Expand All @@ -88,17 +89,14 @@ OT2_S_v3_P300SGen1_None_Gen1PipetteSimple,
OT2_S_v4_P300M_P20S_MM_TM_TC1_PD40,
OT2_S_v4_P300S_None_MM_TM_TM_MOAMTemps,
OT2_S_v6_P1000S_None_SimpleTransfer,
OT2_S_v6_P20S_P300M_HS_HSCollision,
OT2_S_v6_P20S_P300M_TransferReTransferLiquid,
OT2_S_v6_P300M_P20S_HS_Smoke620release,
OT2_S_v6_P300M_P20S_MixTransferManyLiquids,
OT2_S_v6_P300M_P300S_HS_HS_NormalUseWithTransfer,
OT2_X_v2_11_P300S_TC1_TC2_ThermocyclerMoamError,
OT2_X_v2_13_None_None_PythonSyntaxError,
OT2_X_v2_16_NO_PIPETTES_TC_verifyThermocyclerLoadedSlots,
OT2_X_v2_16_None_None_HS_HeaterShakerConflictWithTrashBin1,
OT2_X_v2_16_None_None_HS_HeaterShakerConflictWithTrashBin2,
OT2_X_v2_17_P300M_P20S_HS_TC_TM_dispense_changes,
OT2_X_v2_18_None_None_NoRTPdisplay_name,
OT2_X_v2_18_None_None_StrRTPwith_unit,
OT2_X_v2_18_None_None_duplicateRTPVariableName,
Expand All @@ -107,7 +105,6 @@ OT2_X_v4_P300M_P20S_MM_TC1_TM_e2eTests,
OT2_X_v6_P20S_None_SimpleTransfer,
OT2_X_v6_P300M_P20S_HS_MM_TM_TC_AllMods
"

APP_ANALYSIS_TEST_PROTOCOLS_WITH_OVERRIDES="
Flex_X_v2_18_NO_PIPETTES_Overrides_BadTypesInRTP,
Flex_X_v2_18_NO_PIPETTES_Overrides_DefaultChoiceNoMatchChoice,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14171,7 +14171,7 @@
"errors": [],
"files": [
{
"name": "OT2_P10S_P300M_TC1_TM_MM_2_11_Swift.py",
"name": "OT2_S_v2_11_P10S_P300M_MM_TC1_TM_Swift.py",
"role": "main"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4256,7 +4256,7 @@
"errors": [],
"files": [
{
"name": "OT2_P20S_None_2_7_Walkthrough.py",
"name": "OT2_S_v2_7_P20S_None_Walkthrough.py",
"role": "main"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10424,7 +10424,7 @@
"errors": [],
"files": [
{
"name": "Flex_P1000_96_GRIPPER_HS_TM_TC_MB_2_16_DeckConfiguration1_NoFixtures.py",
"name": "Flex_S_v2_16_P1000_96_GRIP_HS_MB_TC_TM_DeckConfiguration1NoFixtures.py",
"role": "main"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2775,7 +2775,7 @@
"errors": [],
"files": [
{
"name": "OT2_P300M_P20S_2_16_aspirateDispenseMix0Volume.py",
"name": "OT2_S_v2_16_P300M_P20S_aspirateDispenseMix0Volume.py",
"role": "main"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2965,7 +2965,7 @@
"errors": [],
"files": [
{
"name": "OT2_P300M_P20S_TC_HS_TM_2_15_dispense_changes.py",
"name": "OT2_S_v2_15_P300M_P20S_HS_TC_TM_dispense_changes.py",
"role": "main"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"errors": [],
"files": [
{
"name": "OT2_None_None_TC_2_14_VerifyThermocyclerLoadedSlots.py",
"name": "OT2_S_v2_14_NO_PIPETTES_TC_VerifyThermocyclerLoadedSlots.py",
"role": "main"
},
{
Expand Down
Loading

0 comments on commit 4eac5a2

Please sign in to comment.