81 lines
2.4 KiB
Markdown
81 lines
2.4 KiB
Markdown
# Usage Guide
|
|
|
|
This guide provides instructions on how to deploy, configure, and use the TestArena system.
|
|
|
|
## Deployment
|
|
|
|
The system is designed to be deployed on an Ubuntu server. An automated deployment script is provided.
|
|
|
|
### Prerequisites
|
|
* Ubuntu 22.04 or later.
|
|
* ESP-IDF installed at `/home/asf/esp/esp-idf`.
|
|
* QEMU (XTENSA) installed and available in the system path.
|
|
|
|
### Installation Steps
|
|
1. Clone the repository to `/home/asf/testarena_backend`.
|
|
2. Navigate to the directory: `cd /home/asf/testarena_backend`.
|
|
3. Run the deployment script with sudo:
|
|
```bash
|
|
sudo ./deploy.sh
|
|
```
|
|
This script will:
|
|
* Install system dependencies (`nginx`, `sqlite3`, `perl`, etc.).
|
|
* Set up a Python virtual environment and install requirements.
|
|
* Configure Nginx as a reverse proxy.
|
|
* Set up and enable systemd services for the API and Worker.
|
|
|
|
## Managing Services
|
|
|
|
Use standard `systemctl` commands to manage the TestArena services:
|
|
|
|
```bash
|
|
# Restart services
|
|
sudo systemctl restart testarena-app testarena-worker
|
|
|
|
# Check status
|
|
sudo systemctl status testarena-app testarena-worker
|
|
|
|
# View logs
|
|
sudo journalctl -u testarena-worker -f
|
|
```
|
|
|
|
## Using the Dashboard
|
|
|
|
Access the dashboard at `http://<server-ip>:8080/`.
|
|
|
|
### Features:
|
|
* **Queue Monitor**: View all test queues, their status, and environment.
|
|
* **Search**: Filter queues by Queue ID using the search box.
|
|
* **Sorting**: Click on table headers (Queue ID, Environment, Status) to sort the data.
|
|
* **Actions**:
|
|
* **Abort**: Stop a running or waiting queue.
|
|
* **Delete**: Permanently remove a queue's data from the database and filesystem.
|
|
* **Live Logs**: View real-time system logs in the sidebar.
|
|
|
|
## Submitting a Test Queue
|
|
|
|
You can submit a new test queue by sending a POST request to `/api/queue`.
|
|
|
|
### Example Payload:
|
|
```json
|
|
{
|
|
"source": "feature/new-sensor",
|
|
"QUEUE_12345": [
|
|
"Production_Env",
|
|
{
|
|
"TASK_001": "path/to/scenario_1.xml",
|
|
"TASK_002": "path/to/scenario_2.xml"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## Viewing Results
|
|
|
|
Test results are stored in `/home/asf/testarena/<queue_id>/`.
|
|
* `queue_log.txt`: The full execution log for the entire queue.
|
|
* `<task_id>/execution_report.html`: A detailed HTML report for a specific task.
|
|
* `<task_id>/<case_id>-logging.html`: Individual logs for each test case.
|
|
|
|
You can also browse results via the web interface at `http://<server-ip>:8080/results/`.
|