Metadata-Version: 2.4
Name: turbobench
Version: 3.0.2
Summary: TurboBench — Automotive test automation for real benches: browser designer, RDP-native execution, turboadb/turbossh transports, Allure-grade reports
Author-email: Naveen Daniel Kennedy <nvnkennedy@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/nvnkennedy/turbobench
Keywords: test-automation,automotive,bench,hil,rdp,ssh,adb,dlt,ecu,allure
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Framework :: FastAPI
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.110
Requires-Dist: uvicorn[standard]>=0.29
Requires-Dist: sqlalchemy>=2.0
Requires-Dist: pydantic>=2.5
Requires-Dist: apscheduler<4,>=3.10
Requires-Dist: paramiko>=2.11
Requires-Dist: cryptography>=42.0
Requires-Dist: websockets>=11.0
Requires-Dist: pyserial>=3.5
Requires-Dist: structlog>=24.1
Requires-Dist: prometheus-client>=0.20
Requires-Dist: turboadb>=1.0.14
Requires-Dist: turbossh>=1.2.31
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: httpx>=0.27; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Requires-Dist: mypy>=1.8; extra == "dev"
Requires-Dist: pre-commit>=3.5; extra == "dev"
Dynamic: license-file

<div align="center">

# ⚡ TurboBench

**Automotive test automation for real benches.**

Design tests in the browser · run them *in* the RDP machine · evidence-rich reports.

[![PyPI](https://img.shields.io/pypi/v/turbobench?color=e8443a&label=PyPI)](https://pypi.org/project/turbobench/)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://pypi.org/project/turbobench/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](#license)
[![Family](https://img.shields.io/badge/family-turboadb%20·%20turbossh-orange)](https://pypi.org/project/turboadb/)

`pip install turbobench` → `tb` → your browser opens. That's the whole setup.

</div>

---

## The problem it solves

Automotive targets — Android head units, Linux/QNX ECUs, anything on adb, SSH
or a COM port — live cabled to bench PCs that you reach over RDP. Testing them
usually means brittle personal scripts, copy-pasted terminals, and screenshots
pasted into spreadsheets.

TurboBench replaces that with one workflow:

```
 design in the browser  →  the RDP machine runs the test itself  →  report with evidence
```

- **Manual engineers** build tests from 100+ ready templates — no code.
- **Python engineers** drop in any CLI script and it becomes a drag-and-drop step.
- **Everyone** gets the same reports: expected vs actual per step, webcam
  photos/videos, screen recordings, DLT/logcat attachments, trends.

## Highlights

| | |
|---|---|
| 🎨 **Visual designer** | Flow canvas + list editor, expected results (contains / wildcard / regex / **must-NOT-contain**), retries, loops, parallel groups, pause-before, soft steps |
| 🖥 **Run in RDP** | The bench PC executes the whole test natively — its adb, its scripts, its cabled devices. No per-step SSH round-trips (automatic fallback when a step needs the server) |
| ⏺ **Recorder** | Try real commands live, keep the good ones, save as a test case — record & playback without screen-scraping |
| 🔁 **Stability runs** | Endurance cycles with stop conditions (duration, consecutive failures, failure rate) and per-cycle results |
| 🧩 **Any script is a step** | `.py` / `.ps1` / `.bat` / `.exe` with args — run directly, or register once and pick from a dropdown. Custom plugins add whole new step families in ~20 lines (hot-reload, no restart) |
| 🚗 **Automotive built-ins** | DLT capture · power control · ETFW · serial console · adb & SSH template libraries · webcam evidence · PC-screen recording · RDP desktop capture |
| 📊 **Reports that convince** | Allure-style + Playwright-style HTML, true Allure export with trend history, JUnit, suite roll-ups, email, Jira Xray (Cloud **and** Server/DC) |
| 📅 **Scheduler** | Once / daily / weekly / cron, active windows, end-after-N-runs, stop-on-fail |
| 🔐 **Team-ready** | Projects with target capability profiles, AES-256-GCM credential vault, roles, authorship & versioning, resource locks |
| 📦 **Zero-dependency option** | One wheel — or a portable zip with Python embedded for benches where nothing may be installed |

## Quick start

```bash
pip install turbobench     # pulls turboadb + turbossh automatically
tb                         # starts the server and opens the browser
```

First five minutes:

1. **Configuration** — add your RDP machine / SSH device / Android serial
   (auto-detected dropdowns, one *Test* button each).
2. **Test Designer** — drop in templates ("Check boot completed", "Webcam
   photo", "Run a script/.exe"), set expected results.
3. **Run ▸ Run on: your RDP machine** — the bench executes it and the
   Execution console streams every step live.
4. **Reports** — open the run: expected vs actual, evidence gallery, Allure,
   email, Xray.

### Locked-down bench? Use the portable build

```bash
python scripts/build_pypi.py       # dist/turbobench-<ver>.whl (UI included)
python scripts/build_portable.py   # dist/turbobench-portable-win64.zip
```

Unzip on the bench, double-click `TurboBench.cmd` — Python is inside, no
installation, no admin rights.

## Your scripts, three ways

<details>
<summary><b>1 · Just run it</b> — fastest, zero setup</summary>

```
Action:  Run a script/.exe file (with args)     [system.run_file]
path:    C:/bench/power_control.py
args:    ["normal_power_cycle", "--port", "COM5"]
```

Interpreter comes from the extension (`.py`→Python, `.ps1`→PowerShell,
`.bat`→cmd, `.sh`→bash, else run directly). Add expected-output rules and the
**Attach output** toggle for evidence.
</details>

<details>
<summary><b>2 · Register it once</b> — then it's a dropdown for the whole team</summary>

Register under **Templates → Scripts** (path, interpreter, subcommands). Steps
then use `Run a registered script subcommand` and pick from a list — nobody
types ids or paths twice.
</details>

<details>
<summary><b>3 · Write a plugin</b> — a whole new step family in ~20 lines</summary>

**Plugins → Download starter plugin**, edit `adapter.py`, unzip into
`data/plugins/`, press **Reload plugins**. Your actions appear in the designer
immediately — no restart, no rebuild.
</details>

Every path supports `cwd`, `env`, timeout, retries, repeat, continue-on-fail,
`{{steps.N.output}}` placeholders, and file-pattern assertions
(`match_file` + `match_pattern`).

## Two eyes on the target

- **Webcam** steps use the USB camera pointed at the display — proof of what
  physically showed.
- **PC screen** steps capture the bench PC's desktop (screenshot or
  recording); the `RDP machine: desktop …` steps do the same on a remote box.
- **Live Feed** streams either one, clearly labelled.

## Architecture in 30 seconds

```
Browser (React) ── REST/WS ── FastAPI server ── SQLite ── artifacts/
     designer · recorder · scheduler · reports · vault · plugins
                        │
     "Run in RDP": test pushed over SSH (turbossh), executed natively
     by the bench PC (its adb via turboadb, its scripts, its devices),
     results + evidence pulled back automatically
                        │
   Android · Linux · QNX · serial · power rig · webcam — cabled to the bench
```

Exports keep you portable: every test case downloads as a standalone
**pytest** file that runs anywhere with plain `pytest`.

## Development

```bash
scripts/run-dev.ps1          # backend :8000 + Vite HMR frontend :5173
python -m pytest tests/      # unit suite
```

## License

MIT © Naveen Daniel Kennedy — built on
[turboadb](https://pypi.org/project/turboadb/) and
[turbossh](https://pypi.org/project/turbossh/).
