E2E test CLI for the analytics-python SDK. Accepts a JSON input describing events and SDK configuration, sends them through the real SDK, and outputs results as JSON.
# From repo root — activates Python 3.12 and installs deps automatically
devbox shell
# Then from e2e-cli dir:
./run-e2e.shRequires Python 3.9+ and Node.js 18+. Using a virtualenv is strongly recommended since macOS system Python is externally managed.
python3 -m venv .venv
source .venv/bin/activate
./run-e2e.shE2E_TESTS_DIR=../my-e2e-tests ./run-e2e.she2e-cli --input '{"writeKey":"...", ...}'Or without installing:
python3 src/cli.py --input '{"writeKey":"...", ...}'Note: Python is a server-side SDK — there is no CDN settings fetch, so cdnHost does not apply.
{ "success": true, "sentBatches": 1 }On failure:
{ "success": false, "error": "description", "sentBatches": 0 }
{ "writeKey": "your-write-key", // required "apiHost": "https://...", // optional — defaults to https://api.segment.io "sequences": [ // required — event sequences to send { "delayMs": 0, "events": [ { "type": "track", "event": "Test", "userId": "user-1" } ] } ], "config": { // optional "flushAt": 100, // upload_size in Python SDK "flushInterval": 500, // ms (auto-converted to seconds if > 100) "maxRetries": 10, "timeout": 15 } }