Skip to content

Commit f356149

Browse files
Labware sense enable argument for cycling test (#18754)
# Overview adds an argument to enable labware sensing in the cycling test. default is off, labware is not sensed so test can run faster ## Test Plan and Hands on Testing tested on 4 stackers works ## Changelog ## Review requests ## Risk assessment
1 parent da4a69e commit f356149

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

hardware-testing/hardware_testing/modules/flex_stacker_cycle_qc/__main__.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ async def build_stacker_report(
4545
return report, stacker
4646

4747

48-
async def _main(cfg: TestConfig, cycles: int, labware_height: int) -> None:
48+
async def _main(
49+
cfg: TestConfig, cycles: int, labware_height: int, labware_sense: bool
50+
) -> None:
4951
# BUILD REPORT
5052
ports = []
5153
for i in comports():
@@ -79,7 +81,14 @@ async def _main(cfg: TestConfig, cycles: int, labware_height: int) -> None:
7981
tasks = []
8082
for sn, (report, stacker) in stackers.items():
8183
tasks.append(
82-
test_run(stacker, report, section.value, cycles, labware_height)
84+
test_run(
85+
stacker,
86+
report,
87+
section.value,
88+
cycles,
89+
labware_height,
90+
labware_sense,
91+
)
8392
)
8493
await asyncio.gather(*tasks) # Run all tasks concurrently
8594
except Exception as e:
@@ -107,6 +116,11 @@ async def _main(cfg: TestConfig, cycles: int, labware_height: int) -> None:
107116
default=DEFAULT_LABWARE_HEIGHT,
108117
help="LabwareHeight - stackingOffsetWithLabware, in mm",
109118
)
119+
parser.add_argument(
120+
"--labware-sense",
121+
action="store_true",
122+
help="Enable labware sensing",
123+
)
110124
# add each test-section as a skippable argument (eg: --skip-connectivity)
111125
for s in TestSection:
112126
parser.add_argument(f"--skip-{s.value.lower()}", action="store_true")
@@ -122,4 +136,4 @@ async def _main(cfg: TestConfig, cycles: int, labware_height: int) -> None:
122136
s: f for s, f in TESTS if not getattr(args, f"skip_{s.value.lower()}")
123137
}
124138
_config = TestConfig(simulate=args.simulate, tests=_t_sections)
125-
asyncio.run(_main(_config, args.cycles, args.labware_height))
139+
asyncio.run(_main(_config, args.cycles, args.labware_height, args.labware_sense))

hardware-testing/hardware_testing/modules/flex_stacker_cycle_qc/test_cycles.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def print_cycle(stacker: FlexStacker, cycle: int, total_cycles: int) -> None:
2626

2727

2828
async def test_cycles(
29-
stacker: FlexStacker, cycles: int, labware_height: int
29+
stacker: FlexStacker, cycles: int, labware_height: int, labware_sense: bool
3030
) -> Tuple[bool, int]:
3131
"""Test Cycling Labware on Stacker."""
3232
cycles_completed = 0
@@ -35,11 +35,11 @@ async def test_cycles(
3535
try:
3636
await stacker.dispense_labware(
3737
labware_height,
38-
enforce_hopper_lw_sensing=False,
39-
enforce_shuttle_lw_sensing=False,
38+
enforce_hopper_lw_sensing=labware_sense,
39+
enforce_shuttle_lw_sensing=labware_sense,
4040
)
4141
await stacker.store_labware(
42-
labware_height, enforce_shuttle_lw_sensing=False
42+
labware_height, enforce_shuttle_lw_sensing=labware_sense
4343
)
4444
except Exception as e:
4545
ui.print_error(f"{stacker.device_info['serial']}: An error occurred: {e}")
@@ -59,11 +59,14 @@ async def run(
5959
section: str,
6060
cycles: int,
6161
labware_height: int,
62+
labware_sense: bool,
6263
) -> None:
6364
"""Run."""
6465
ui.print_header(f"Cycle Test - {stacker.device_info['serial']}")
6566

6667
await stacker.home_all()
67-
cycle_result, cycles_completed = await test_cycles(stacker, cycles, labware_height)
68+
cycle_result, cycles_completed = await test_cycles(
69+
stacker, cycles, labware_height, labware_sense
70+
)
6871

6972
report(section, "cycle", [cycles_completed, CSVResult.from_bool(cycle_result)])

0 commit comments

Comments
 (0)