Skip to main content

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_id and target.
  • Jobs with the same app version and target are batched to minimize app installs.
  • Prioritization: lower priority value = 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

  1. Start backend and agents (see Docker or local setup above).
  2. Submit a job:
    qgjob submit --org-id qualgent --app-version-id xyz123 --test tests/onboarding.spec.js --target emulator
    
  3. Check status:
    qgjob status --job-id <job_id> --poll
    
  4. 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.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qgjob-1.1.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file qgjob-1.1.0.tar.gz.

File metadata

  • Download URL: qgjob-1.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for qgjob-1.1.0.tar.gz
Algorithm Hash digest
SHA256 422513e2f42db3527193a33843c3c086bd2e2ea881c0dc29d7458b1b6eb457c4
MD5 2b624fe015467bbf27e1216656b31736
BLAKE2b-256 04d8177cabcd14ddffc9ba36d1f3d94eb4ed165645d86e22953dab6bd0864ee1

See more details on using hashes here.

File details

Details for the file qgjob-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: qgjob-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for qgjob-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a764a4a4dc4278cc5fe07fa62282c4fdfafc9ef5c8407accbdddcce842261b60
MD5 01badc8a743fe3b1664fe9a24692242c
BLAKE2b-256 d3816a09dad2646a3897a51227ae6f7c982d295f5fa094d42958fa72bef4c1b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page