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.4.0.tar.gz (11.5 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.4.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

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

Hashes for qgjob-1.4.0.tar.gz
Algorithm Hash digest
SHA256 5a1833892f46d591ca58bf3cc181b19512f5b139d8a5301c772d3204b25460c6
MD5 f7183eb21af0f2adbfaf7a0b8ed21130
BLAKE2b-256 f48f560dded5b14dbb09780d4d79c0e74cb8b8a4fbd796d71e7de2bd1eeab7f1

See more details on using hashes here.

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

Hashes for qgjob-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e1310c04b8bc871641e2eb6cd888232ff6fd053852df61673e2c47640aeff81
MD5 4dcac9aaf5249b6bf3c5564e32611a11
BLAKE2b-256 475faaa626c2358b5b277301699e18d08eb660ea2dd03ed67f3ea2d27ae0a596

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