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

feat(abr-testing): add module tests #17127

Merged
merged 12 commits into from
Dec 20, 2024
Prev Previous commit
finalized tests for thermocycler and heater shaker
AnthonyNASC20 committed Dec 20, 2024
commit a51c929681b47d69f2216b3e0451441adc5bbacb
2 changes: 1 addition & 1 deletion abr-testing/abr_testing/tools/module_control.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make more clear that it is only set up for heatershaker currently or add thermocycler / temperatre module functionality

Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ async def handle_module_gcode_shortcut(

if output:
try:
with open(output, "w") as result_file:
with open(output, "a") as result_file:
if "OK" in mr:
status = command + ": SUCCESS"
else:
18 changes: 12 additions & 6 deletions abr-testing/abr_testing/tools/test_modules.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Modules Tests Script!"""
import asyncio
import time
import traceback
from datetime import datetime
import os
import module_control # type: ignore
from typing import Any, Tuple, Dict
import traceback

# To run:
# SSH into robot
@@ -88,14 +89,19 @@ async def main(module: str) -> None:
print(f"{i}) {test} : {description}")
selected_test = int(input("Please select a test: "))
try:
print('testing 1...')
function, description = tests[list(tests.keys())[selected_test]]
print('testing 2...')
test_dir = BASE_DIRECTORY + f"{module}/test/{list(tests.keys())[selected_test]}"
print('testing 3...')
print(f"{i}, {description}")
print(f'TEST DIR: {test_dir}')
output_file = os.path.join(test_dir, "results.txt")
print(f"TEST DIR: {test_dir}")
date = datetime.now()
filename = f"results_{datetime.strftime(date, '%Y-%m-%d_%H:%M:%S')}.txt"
output_file = os.path.join(test_dir, filename)
try:
if not os.path.exists(test_dir):
os.makedirs(test_dir)
open(output_file, "a").close()
except Exception:
traceback.print_exc()
print(f"PATH: {output_file} ")
await (function(module, output_file))
except Exception: