update DB table

This commit is contained in:
2025-12-28 03:46:11 +01:00
parent de08431e53
commit 1ae11b02ce
3 changed files with 11 additions and 4 deletions

View File

@@ -77,13 +77,16 @@ def run_test_suite(tasks):
print(f"--- Starting Task: {task['id']} ---")
# Use Popen to stream output in real-time
env = os.environ.copy()
env["PYTHONUNBUFFERED"] = "1"
process = subprocess.Popen(
[shell_script, task['id'], task['cmd'], task['path'], REPO_PATH],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True,
bufsize=1,
universal_newlines=True
universal_newlines=True,
env=env
)
full_output = ""

View File

@@ -38,8 +38,9 @@ EOF
# 1. CD into the repo path
# 2. Execute command and capture output
# 3. PIPESTATUS[0] captures the exit code of the eval "$CMD"
export PYTHONUNBUFFERED=1
echo "--- Execution Start ---" | tee -a >(sed 's/$/<br>/' >> "$LOG_FILE")
cd "$REPO_PATH" && eval "$CMD" 2>&1 | tee -a >(sed 's/$/<br>/' >> "$LOG_FILE")
cd "$REPO_PATH" && stdbuf -oL -eL eval "$CMD" 2>&1 | tee -a >(sed 's/$/<br>/' >> "$LOG_FILE")
EXIT_CODE=${PIPESTATUS[0]}
echo "--- Execution End (Exit Code: $EXIT_CODE) ---" | tee -a >(sed 's/$/<br>/' >> "$LOG_FILE")

View File

@@ -139,9 +139,12 @@ def run_worker():
checkout_cmd = f"./TPF/gitea_repo_controller.sh checkout {queue.source}"
run_command_with_logging(checkout_cmd, queue_log)
# Clean up any orphaned QEMU processes
run_command_with_logging("pkill -f qemu-system-xtensa || true", queue_log)
# 1-5 Build software and run QEMU
# We stop when we see the multicore app start message
build_cmd = f"/bin/bash -c 'source $HOME/esp/esp-idf/export.sh && cd TPF/Sensor_hub_repo && idf.py build && idf.py qemu'"
build_cmd = f"/bin/bash -c 'export PYTHONUNBUFFERED=1 && source $HOME/esp/esp-idf/export.sh && cd TPF/Sensor_hub_repo && idf.py build && idf.py qemu'"
run_command_with_logging(build_cmd, queue_log, stop_string="cpu_start: Multicore app")
# 9- Loop for each task
@@ -162,7 +165,7 @@ def run_worker():
# It must be executed from TPF/Sensor_hub_repo with IDF sourced
script_path = os.path.abspath("./TPF/scenario_execution.py")
repo_dir = os.path.abspath("./TPF/Sensor_hub_repo")
cmd = f"/bin/bash -c 'source $HOME/esp/esp-idf/export.sh && python3 {script_path} {queue.id} {task.scenario_path} {task.id}'"
cmd = f"/bin/bash -c 'export PYTHONUNBUFFERED=1 && source $HOME/esp/esp-idf/export.sh && python3 {script_path} {queue.id} {task.scenario_path} {task.id}'"
task_dir = os.path.join(queue_dir, task.id)
os.makedirs(task_dir, exist_ok=True)