Files
testarena_backend/deployment_guide.md
2025-12-27 20:08:16 +01:00

81 lines
2.5 KiB
Markdown

# TestArena Deployment & Testing Guide
This guide explains how to deploy and test the TestArena backend application on your Ubuntu Server.
## 🚀 Deployment Steps
### 1. Clone the Repository
Ensure you have the code on your server in a directory like `/home/asf/testarena_pc_backend`.
### 2. Run the Deployment Script
The deployment script automates Nginx configuration and dependency installation.
```bash
sudo chmod +x deploy.sh
sudo ./deploy.sh
```
### 3. Manage Application Services
The application and worker are managed by `systemd`. You can control them using the following commands:
**Check Status:**
```bash
sudo systemctl status testarena-app
sudo systemctl status testarena-worker
```
**Restart Services:**
```bash
sudo systemctl restart testarena-app
sudo systemctl restart testarena-worker
```
---
## 🧪 Testing the System
### 1. Verify Dashboard Access
Open your browser and navigate to:
`http://asf-server.duckdns.org:8080/`
You should see the modern, colorful TestArena dashboard.
### 2. Verify Results Browsing
Navigate to:
`http://asf-server.duckdns.org:8080/results/`
You should see an automatic directory listing of `/home/asf/testarena/`.
### 3. Test the Queue API
Run the following `curl` command to queue a test task with branch information:
```bash
curl -X POST http://asf-server.duckdns.org:8080/api/queue \
-H "Content-Type: application/json" \
-d '{
"source": "add_esp_idf_io_wrappers",
"345": [
"staging",
{
"5555": "application_layer/business_stack/actuator_manager/test/actuator_manager_init_test.test_scenario.xml"
}
]
}'
```
### 4. Verify Worker Execution
- Check the dashboard; you should see the new queue appear and its status change from `Waiting` to `Running` and then `Finished`.
- Check the filesystem:
```bash
ls -R /home/asf/testarena/test_queue_001
```
You should see `queue_status.json` and any results generated by `tpf_execution.py`.
### 5. Test Abortion
Queue another task and click the **Abort** button on the dashboard. Verify that the status changes to `Aborted` in both the dashboard and the `queue_status.json` file.
---
## 🛠️ Troubleshooting
- **Nginx Errors**: Check logs with `sudo tail -f /var/log/nginx/error.log`.
- **FastAPI Errors**: Check the terminal where `uvicorn` is running.
- **Permission Issues**: Ensure `/home/asf/testarena` is writable by the user running the app.
- **Port 8080 Blocked**: Ensure your firewall (ufw) allows traffic on port 8080: `sudo ufw allow 8080`.