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.3.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.3.0-py3-none-any.whl
(17.4 kB
view details)
File details
Details for the file qgjob-1.3.0.tar.gz.
File metadata
- Download URL: qgjob-1.3.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 |
5e9d01cfd282f0821c16afbe7c879010ec50b3e6f0210d9018405c2d8207c576
|
|
| MD5 |
32d36bb5acd46a9959c88742a367caaf
|
|
| BLAKE2b-256 |
ddcfabf22263b3d2a2fef9729ed7ce7f04aa19496851b4667ab378dce75f19c1
|
File details
Details for the file qgjob-1.3.0-py3-none-any.whl.
File metadata
- Download URL: qgjob-1.3.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 |
5a434854ee2421e1c1d8901f0569cf0a120f35469bb1ea9feef1352c01b2c216
|
|
| MD5 |
71c4675272583594d8f2ac873b2f8fa2
|
|
| BLAKE2b-256 |
25bd7035bbf9f7a5e550db9f61bfa77ca3c4e9b0d496b6797c76fab05d8f9227
|