Skip to content
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
13 changes: 11 additions & 2 deletions framework/python/src/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,18 @@ async def edit_device(self, request: Request, response: Response):
return self._generate_msg(False, "Invalid JSON received")

async def get_report(self, response: Response, device_name, timestamp):

file_path = os.path.join(DEVICES_PATH, device_name, "reports", timestamp,
device = self._session.get_device_by_name(device_name)

# 1.3 file path
file_path = os.path.join(DEVICES_PATH, device_name, "reports", timestamp,'test',
device.mac_addr.replace(':',''),
"report.pdf")
if not os.path.isfile(file_path):
# pre 1.3 file path
file_path = os.path.join(DEVICES_PATH, device_name, "reports", timestamp,
"report.pdf")


LOGGER.debug(f"Received get report request for {device_name} / {timestamp}")
if os.path.isfile(file_path):
return FileResponse(file_path)
Expand Down
10 changes: 10 additions & 0 deletions framework/python/src/core/testrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,20 @@ def _load_test_reports(self, device):
LOGGER.info(f'Loading reports from {reports_folder}')

for report_folder in os.listdir(reports_folder):
# 1.3 file path
report_json_file_path = os.path.join(
reports_folder,
report_folder,
'test',
device.mac_addr.replace(':',''),
'report.json')

if not os.path.isfile(report_json_file_path):
# Revert to pre 1.3 file path
report_json_file_path = os.path.join(
reports_folder,
report_folder,
'report.json')

# Check if the report.json file exists
if not os.path.isfile(report_json_file_path):
Expand Down
7 changes: 2 additions & 5 deletions framework/python/src/test_orc/test_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ def _find_oldest_test(self, completed_tests_dir):
def _timestamp_results(self, device):

# Define the current device results directory
cur_results_dir = os.path.join(self._root_path, RUNTIME_TEST_DIR,
device.mac_addr.replace(":", ""))
cur_results_dir = os.path.join(self._root_path, RUNTIME_DIR)

# Define the directory
completed_results_dir = os.path.join(
Expand Down Expand Up @@ -273,9 +272,7 @@ def zip_results(self,
timestamp)

# Define where to save the zip file
zip_location = os.path.join(LOCAL_DEVICE_REPORTS.replace(
"{device_folder}", device.device_folder), timestamp
)
zip_location = os.path.join('/tmp/testrun',timestamp)

# Delete ZIP if it already exists
if os.path.exists(zip_location + ".zip"):
Expand Down