SPARTA is a session orchestration layer for parallel Android QA automation with Appium.
It focuses on the part that usually breaks first in large mobile test farms:
- picking the right Appium server
- leasing a collision-free
systemPort - keeping that lease alive
- releasing or reclaiming it safely
- multiple Appium server coordination
- capacity-aware session placement
- lease-based
systemPortallocation - local memory mode for fast onboarding
- Redis-backed node-agent leases for more durable shared usage
- automation-friendly HTTP APIs and example Node.js clients
Current repo state: v0.3.0
| Area | Status | Notes |
|---|---|---|
| Control-plane register / allocate / heartbeat / release | Stable | Covered by tests and examples |
| Node-agent memory backend | Stable | Best default for local onboarding |
| Node-agent Redis backend | Stable | Durable lease state for shared use |
| Multiple Appium servers | Stable | Supports capacity-aware balancing and filtering |
| Server tags / metadata filters | Stable | Use requiredTags and requiredMetadata on allocation |
| 1000 logical session placement simulation | Verified | Run npm run benchmark:scale |
| Multi-instance control-plane durability | Not yet | Control-plane state is still in-memory |
| UI / RBAC / metrics exporter | Not yet | Deliberately out of scope for this release |
npm install
npm --workspace @sparta/node-agent run start -- --host 127.0.0.1 --port 8731 --port-range 8200-8299
npm --workspace @sparta/control-plane run start -- --host 127.0.0.1 --port 4400If you want durable node-agent leases:
npm run redis:up
npm --workspace @sparta/node-agent run start -- --backend redis --redis-url redis://127.0.0.1:6379 --redis-prefix sparta:node-agentIf you want a full local stack with containers:
docker compose -f docker-compose.local.yml up --buildSPARTA uses the SPARTA_* prefix as the canonical env surface.
Main variables:
SPARTA_CONTROL_PLANE_HOSTSPARTA_CONTROL_PLANE_PORTSPARTA_SELECTION_POLICYSPARTA_NODE_AGENT_HOSTSPARTA_NODE_AGENT_PORTSPARTA_NODE_AGENT_LEASE_BACKENDSPARTA_REDIS_URLSPARTA_REDIS_PREFIXSPARTA_AUTH_TOKEN
Config file examples:
Legacy aliases such as CONTROL_PLANE_*, NODE_AGENT_*, LEASE_STORE_MODE, and REDIS_URL are still accepted for compatibility.
- root test suite passes across all workspaces with
npm test - 1000 logical session placement simulation is included via
npm run benchmark:scale - burst allocation test proves one server is not overbooked under concurrent allocation requests
- background routine test proves poller/janitor loops do not overlap when work runs longer than the interval
- control-plane scheduling supports multiple Appium servers, tags, metadata filters, and
least-loadedorround-robinpolicy
apps/control-planefor scheduling and session lifecycle orchestrationapps/node-agentfor host-local lease management and cleanuppackages/lease-managerfor reusable in-memory and Redis-backed lease allocationpackages/shared-typesfor shared payload contracts and constantsexamples/developer-test-runnerfor runnable consumer integrationsbenchmarks/for scale simulation and end-to-end load / soak harnessesbenchmarks/resultsfor generated benchmark reportsdocs/for onboarding, deployment, scale, troubleshooting, and glossaryopenapi.yamlfor the HTTP contract
- Getting Started
- Glossary
- Deployment
- Scale Guide
- Benchmark Guide
- Examples
- Lease Lifecycle
- Troubleshooting
- OpenAPI Spec
SPARTA v0.3.0 is ready for local teams, CI pilots, and early self-hosting.
The most production-friendly shape today is:
- one active control-plane instance
- one node-agent per lease domain or host
- Redis enabled on node-agents when you want durable lease coordination
- Appium managed separately and registered explicitly
If you want multi-control-plane durability, that is the next major hardening step, not something this repo pretends to have already solved.