Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(app-testing): full phase 1 app analysis battery #12143

Merged
merged 11 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app-testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ lint:
format:
$(MAKE) black
$(MAKE) ruff
$(MAKE) format-readme

.PHONY: test-ci
test-ci:
Expand All @@ -43,4 +44,8 @@ teardown:

.PHONY: format-readme
format-readme:
yarn prettier --write README.md
yarn prettier --ignore-path .eslintignore --write app-testing/**/*.md

.PHONY: print-protocols
print-protocols:
pipenv run python print_protocols.py
2 changes: 1 addition & 1 deletion app-testing/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ atomicwrites = "==1.4.1"
pyreadline3 = "==3.4.1"
pydantic = "==1.10.4"
pygithub = "==1.57"
ruff = "==0.0.211"
ruff = "==0.0.236"

[requires]
python_version = "3.11"
61 changes: 31 additions & 30 deletions app-testing/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion app-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Slices of the tests will be selected as candidates for automation and then perfo
3. Install Chromedriver
1. in the app-testing directory
1. `sudo ./ci-tools/mac_get_chromedriver.sh 21.3.1` per the version of electron in the root package.json for electron
1. Windows `sudo .\windows_get_chromedriver.ps1 -version 21.3.1`
1. Windows `sudo .\ci-tools\windows_get_chromedriver.ps1 -version 21.3.1`
1. if you experience `wget: command not found`
1. brew install wget and try again
2. when you run `chromedriver --version`
Expand Down Expand Up @@ -91,3 +91,15 @@ make remove file_path=$MONOREPOPATH/app-testing/ci-tools/ot2_with_all_modules.ya

- Only have 1 robot connected at once.
- Build locators like you have more than 1 to future proof.

## Analysis Test

The analysis test `pipenv run pytest -k test_analyses` is driven by the comma delimited string variable `APP_ANALYSIS_TEST_PROTOCOLS` in `.env`
This allows us to run one or many.

### Adding protocols

1. add the protocol file named according to the naming convention in the files/protocols appropriate folder
1. add the protocol stem to `protocol_files.py`
1. add the protocol data as a property to `protocols.py`
1. run `make print-protocols`
16 changes: 16 additions & 0 deletions app-testing/automation/data/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Protocol(BaseModel):
robot_error: bool = Field(description="will analysis with the robot raise an error")
app_analysis_error: Optional[str] = Field(description="the exact error shown in the app popout", default=None)
robot_analysis_error: Optional[str] = Field(description="the exact analysis error from the robot", default=None)
custom_labware: Optional[list[str]] = Field(description="list of custom labware file stems", default=None)
instruments: Optional[list[str]] = Field(description="list of instruments that will show in the app", default=None)
modules: Optional[list[module_types]] = Field(description="list of modules that will show in the app", default=None)
description: Optional[str] = Field(description="Details about this protocol", default=None)
Expand All @@ -34,3 +35,18 @@ def file_path(self) -> Path:
f"{self.file_extension}",
f"{self.file_name}.{self.file_extension}",
)

@property
def labware_paths(self) -> list[Path]:
"""Path of the file."""
if self.custom_labware is None:
return []
return [
Path(
Path(__file__).resolve().parent.parent.parent,
os.getenv("FILES_FOLDER", "files"),
"labware",
f"{p}.json",
)
for p in self.custom_labware
]
30 changes: 20 additions & 10 deletions app-testing/automation/data/protocol_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,27 @@
from typing import Literal

names = Literal[
"OT2_P1000SLeft_None_6_1_SimpleTransfer",
"OT2_P20SRight_None_6_1_SimpleTransferError",
"OT2_P20S_P300M_HS_6_1_HS_WithCollision_Error",
"OT2_P20S_P300M_NoMods_6_1_TransferReTransferLiquid",
"OT2_P300M_P20S_HS_6_1_Smoke620release",
"OT2_P300M_P20S_MM_HS_TD_TC_6_1_AllMods_Error",
"OT2_P300M_P20S_MM_TM_TC1_5_2_6_PD40",
"OT2_P300M_P20S_MM_TM_TC1_5_2_6_PD40Error",
"OT2_P300M_P20S_NoMod_6_1_MixTransferManyLiquids",
"OT2_P300M_P300S_HS_6_1_HS_NormalUseWithTransfer",
"OT2_P300SG1_None_5_2_6_Gen1PipetteSimple",
"OT2_P300SLeft_MM_TM_TM_5_2_6_MOAMTemps",
"OT2_None_None_2_12_Python310SyntaxRobotAnalysisOnlyError",
"OT2_None_None_2_13_PythonSyntaxError",
"OT2_P10S_P300M_TC1_TM_MM_2_11_Swift",
"OT2_P20S_None_2_7_Walkthrough",
"OT2_Python_Syntax_Error",
"OT2_P10S_P300M_All_Modules_Swift",
"OT2_P300M_Mag_Temp_Zymo",
"OT2_P300MLeft_MM_TM_2_4_Zymo",
"OT2_P300M_P20S_None_2_12_FailOnRun",
"OT2_P300M_P20S_TC_MM_TM_6_13_Smoke620Release",
"OT2_P300SLeft_MM1_MM_2_2_EngageMagHeightFromBase",
"OT2_P300SLeft_MM1_MM_TM_2_3_Mix",
"OT2_P300S_Thermocycler_Moam_Error",
"OT2_P300S_Twinning_Error",
"OT2_S20_M300_NoMods_6_1_TransferReTransferLiquid",
"OT2_P300M_P20S_MM_HS_TD_TC_6_1_AllMods_Error",
"OT2_P20S_P300M_NoMod_6_1_MixTransferManyLiquids",
"OT2_P20S_P300M_HS_6_1_HS_NormalUseWithTransfer",
"OT2_P20S_P300M_HS_6_1_HS_WithCollision_Error",
"OT2_API_level_2_3",
"OT2_API_level_2_2",
]
Loading