CLI for submitting and tracking AppWright test jobs
Project description
qgjob
A CLI tool and backend to queue, group, and deploy AppWright test jobs across emulators, devices, and BrowserStack.
Features
- Submit and track test jobs via CLI
- Jobs grouped by app version and target for efficient batching
- Prioritization and deduplication
- Retry and failure handling
- Scalable, modular backend
- GitHub Actions integration
Installation
pip install qgjob
Usage
qgjob submit --org-id qualgent --app-version-id xyz123 --test tests/onboarding.spec.js --target emulator
qgjob status --job-id abc456
Setup (Local & Docker)
Local Backend
- Requires Python 3.7+, Redis, and PostgreSQL (or use in-memory for demo)
- Install dependencies:
pip install -r requirements.txt - Start backend:
uvicorn job_server.main:app --reload - Start agent(s):
python job_server/agent_worker.py --target emulator --app-version-id xyz123
Docker Compose
docker compose up --build --scale agent=3
Architecture
flowchart TD
CLI["qgjob CLI"] -->|REST| API["Job Server API"]
API -->|Enqueue| Queue["Job Queue (Redis)"]
API -->|Status| DB[("Job DB")]
Scheduler["Scheduler"] -->|Assign Batch| Agent["Agent Worker(s)"]
Agent -->|Run Tests| Device["Device/Emulator/BrowserStack"]
Agent -->|Update| API
API -->|Status| CLI
Grouping & Scheduling
- Jobs are grouped by
app_version_idandtarget. - Jobs with the same app version and target are batched to minimize app installs.
- Prioritization: lower
priorityvalue = higher priority. - Deduplication: duplicate jobs (same org, app version, test, target) are blocked.
- Retry: failed jobs are retried up to 3 times by default.
End-to-End Example
- Start backend and agents (see Docker or local setup above).
- Submit a job:
qgjob submit --org-id qualgent --app-version-id xyz123 --test tests/onboarding.spec.js --target emulator
- Check status:
qgjob status --job-id <job_id> --poll
- See results in CLI and backend logs.
GitHub Actions Workflow
See .github/workflows/appwright-test.yml for a full CI example:
- Installs backend and CLI
- Submits a test job
- Polls for completion
- Fails build if any test fails
Sample Output Logs
Job submitted! ID: 1234abcd | Status: queued
Job 1234abcd → in_progress
Job 1234abcd → completed
Monitoring
- Health:
GET /healthz - Metrics:
GET /metrics
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qgjob-1.4.0.tar.gz
(11.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
qgjob-1.4.0-py3-none-any.whl
(17.4 kB
view details)
File details
Details for the file qgjob-1.4.0.tar.gz.
File metadata
- Download URL: qgjob-1.4.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a1833892f46d591ca58bf3cc181b19512f5b139d8a5301c772d3204b25460c6
|
|
| MD5 |
f7183eb21af0f2adbfaf7a0b8ed21130
|
|
| BLAKE2b-256 |
f48f560dded5b14dbb09780d4d79c0e74cb8b8a4fbd796d71e7de2bd1eeab7f1
|
File details
Details for the file qgjob-1.4.0-py3-none-any.whl.
File metadata
- Download URL: qgjob-1.4.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e1310c04b8bc871641e2eb6cd888232ff6fd053852df61673e2c47640aeff81
|
|
| MD5 |
4dcac9aaf5249b6bf3c5564e32611a11
|
|
| BLAKE2b-256 |
475faaa626c2358b5b277301699e18d08eb660ea2dd03ed67f3ea2d27ae0a596
|