diff --git a/app/api/api_v1/endpoints/test_run_executions.py b/app/api/api_v1/endpoints/test_run_executions.py index 5c7f75d8..9f6accb8 100644 --- a/app/api/api_v1/endpoints/test_run_executions.py +++ b/app/api/api_v1/endpoints/test_run_executions.py @@ -19,6 +19,7 @@ from http import HTTPStatus from typing import Any, Dict, List, Optional +import requests from fastapi import APIRouter, BackgroundTasks, Depends, File, HTTPException, UploadFile from fastapi.encoders import jsonable_encoder from fastapi.responses import JSONResponse, StreamingResponse @@ -525,6 +526,16 @@ def generate_summary_log( detail="matter_qa_url must be configured", ) + page = requests.get(f"{matter_qa_url}/home") + if page.status_code is not int(HTTPStatus.OK): + raise HTTPException( + status_code=page.status_code, + detail=( + "The LogDisplay server is not responding.\n" + "Verify if the tool was installed, configured and initiated properly" + ), + ) + commissioning_method = project_config.dut_config.pairing_mode test_run_execution = crud.test_run_execution.get(db=db, id=id) diff --git a/scripts/log_display/install_log_display.sh b/scripts/log_display/install_log_display.sh index e512a5ef..7e83adc1 100755 --- a/scripts/log_display/install_log_display.sh +++ b/scripts/log_display/install_log_display.sh @@ -26,7 +26,7 @@ clone_matter_qa() { cd $MATTER_QA_PATH git sparse-checkout set --cone git checkout main - git sparse-checkout set tools + git sparse-checkout set tools src else echo "Matter QA repository already present at path $MATTER_QA_PATH" fi @@ -47,8 +47,10 @@ install_python_dependencies() { sudo apt install uvicorn sudo apt install python-is-python3 python -m venv $VIRTUAL_ENV - $VIRTUAL_ENV/bin/pip install fastapi - $VIRTUAL_ENV/bin/pip install pymongo + source $VIRTUAL_ENV/bin/activate + pip install setuptools + pip install $MATTER_QA_PATH/src/ + deactivate } echo "Log Display install Initiated" diff --git a/scripts/log_display/uninstall_log_display.sh b/scripts/log_display/uninstall_log_display.sh index 2fc5f2e9..595b8793 100755 --- a/scripts/log_display/uninstall_log_display.sh +++ b/scripts/log_display/uninstall_log_display.sh @@ -25,7 +25,7 @@ uninstall_mongodb() { sudo apt-get purge "mongodb-org*" sudo rm -r /var/log/mongodb sudo rm -r /var/lib/mongodb - echo "Done" + echo "MongoDB uninstall Done" } uninstall_python_dependencies() { @@ -33,11 +33,9 @@ uninstall_python_dependencies() { if [ "$VIRTUAL_ENV" != "" ]; then deactivate fi - $VIRTUAL_ENV/bin/pip uninstall pymongo - $VIRTUAL_ENV/bin/pip uninstall fastapi rm -rf $VIRTUAL_ENV sudo apt remove uvicorn - echo "Done" + echo "Packages uninstall Done" } @@ -45,7 +43,7 @@ remove_matter_qa_repo() { if [ -d $MATTER_QA_PATH ]; then echo "Deleting Matter QA repository..." sudo rm -rf $MATTER_QA_PATH - echo "Done" + echo "Matter_QA repository removal Done" else echo "Matter QA repository not in the default location. Please, remove it manually" fi @@ -54,8 +52,8 @@ remove_matter_qa_repo() { echo "Uninstall initiated" echo -echo "The dependencies for LogDisplay app are: MongoDB, uvicorn, [pip] fastapi, [pip] pymongo and the Matter QA repository" -read -p "Are you sure you want to uninstall all those packages? [y/N] " -n 1 -r +echo "The dependencies for LogDisplay app are: MongoDB, uvicorn and the Python packages" +read -p "Are you sure you want to uninstall everything? [y/N] " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]]; then diff --git a/test_collections/matter/sdk_tests/support/performance_tests/utils.py b/test_collections/matter/sdk_tests/support/performance_tests/utils.py index dc170996..db930e9e 100644 --- a/test_collections/matter/sdk_tests/support/performance_tests/utils.py +++ b/test_collections/matter/sdk_tests/support/performance_tests/utils.py @@ -83,7 +83,7 @@ def create_summary_report( tc_name = line.split(": ")[1] if not tc_result: - if line.find("Test Case Completed[") > 0: + if line.find("Test Case Completed [") > 0: extract_datetime(line) m = re.search(r"\[([A-Za-z0-9_]+)\]", line)