5.6 KiB
5.6 KiB
ASF TestArena - Setup Guide
Phase 1 Implementation Status ✅
The following features have been implemented:
-
✅ Login System
- Secure authentication with Flask-Login
- Session management
- Default admin account (username: admin, password: admin123)
-
✅ Modern Theme
- Gradient background design
- Clean, modern UI components
- Responsive layout
- Custom logo integration
-
✅ Admin Dashboard
- User creation with role assignment
- Password reset functionality
- User deletion
- User list with role badges
-
✅ User Dashboard
- Job list panel (left side)
- Job details panel (right side)
- Status indicators with colored icons
- Real-time job selection
-
✅ Submit Page
- Multi-step wizard (5 steps)
- Branch selection
- Scenario selection with checkboxes
- Environment selection (Sensor Hub / Main Board)
- Test mode selection (Devbench Simulator / Testbench HIL)
- Additional options (keep devbenches, reuse results)
-
✅ Docker Compose Setup
- PostgreSQL database
- Flask web application
- Caddy proxy integration ready
- Volume management for test results
Next Steps (Phase 2)
The following features need to be implemented:
-
⏳ Git Integration
- Branch checkout functionality
- Scenario detection script integration
- Repository management
-
⏳ Test Execution Engine
- Background job processing
- Script execution
- Status updates
- Process management
-
⏳ Results Management
- HTML report generation
- Results storage
- Automatic cleanup (7-day retention)
-
⏳ Real-time Updates
- WebSocket integration for live status updates
- Progress tracking
Configuration Steps
1. Update Docker Compose for Caddy
Edit docker-compose.yml and uncomment the Caddy network section:
networks:
testarena_network:
driver: bridge
caddy_network: # Uncomment this
external: true # Uncomment this
Then add the network to the web service:
web:
# ... other config ...
networks:
- testarena_network
- YOUR_CADDY_NETWORK_NAME # Add your actual Caddy network name
2. Configure Caddy
Add to your Caddyfile (see Caddyfile.example):
testarena.nabd-co.com {
reverse_proxy testarena_web:5000
}
3. Update Environment Variables
Copy .env.example to .env and update:
SECRET_KEY=your-secure-random-key-here
DATABASE_URL=postgresql://testarena_user:your-secure-password@db:5432/testarena
4. Start the Application
Run start.bat or:
docker-compose up -d --build
File Structure
testarena/
├── app/
│ ├── __init__.py # Flask app initialization
│ ├── models.py # Database models
│ ├── routes/
│ │ ├── auth.py # Authentication routes
│ │ ├── admin.py # Admin management routes
│ │ ├── dashboard.py # Dashboard routes
│ │ └── jobs.py # Job submission routes
│ ├── templates/
│ │ ├── base.html # Base template
│ │ ├── login.html # Login page
│ │ ├── admin/
│ │ │ └── dashboard.html
│ │ ├── dashboard/
│ │ │ └── index.html
│ │ └── jobs/
│ │ ├── submit.html
│ │ ├── submit_step2.html
│ │ ├── submit_step3.html
│ │ └── submit_step4.html
│ └── static/
│ ├── css/
│ │ └── style.css # Modern theme styles
│ └── uploads/
│ └── icon.png # Logo
├── docker-compose.yml # Docker orchestration
├── Dockerfile # Web app container
├── requirements.txt # Python dependencies
├── wsgi.py # WSGI entry point
└── README.md # Documentation
Database Schema
Users Table
- id (Primary Key)
- username (Unique)
- password_hash
- is_admin (Boolean)
- created_at (Timestamp)
Jobs Table
- id (Primary Key)
- user_id (Foreign Key → Users)
- branch_name
- scenarios (JSON)
- environment
- test_mode
- status (in_progress, passed, failed, aborted)
- submitted_at (Timestamp)
- completed_at (Timestamp, nullable)
- duration (Integer, seconds)
- keep_devbenches (Boolean)
- reuse_results (Boolean)
- results_path (String, nullable)
API Endpoints
Authentication
GET /login- Login pagePOST /login- Login submissionGET /logout- Logout
Dashboard
GET /dashboard/- Main dashboard
Admin
GET /admin/- Admin dashboardPOST /admin/users/create- Create userPOST /admin/users/<id>/reset-password- Reset passwordPOST /admin/users/<id>/delete- Delete user
Jobs
GET /jobs/submit- Submit form (step 1)POST /jobs/submit/step1- Process step 1POST /jobs/submit/step2- Process step 2POST /jobs/submit/step3- Process step 3POST /jobs/submit/final- Submit jobGET /jobs/<id>- Get job details (JSON)POST /jobs/<id>/abort- Abort job
Security Notes
- Change default admin password immediately
- Update SECRET_KEY in production
- Use strong database passwords
- Enable HTTPS via Caddy
- Regular security updates
Troubleshooting
Container won't start
docker-compose logs web
Database connection issues
Check DATABASE_URL in docker-compose.yml
Can't access the site
- Verify Docker containers are running:
docker ps - Check logs:
docker-compose logs -f - Verify Caddy configuration
Support
For issues or questions, contact the development team.