Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

analytics-python e2e-cli

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.

Setup

cd e2e-cli
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .

Usage

e2e-cli --input '{"writeKey":"...", ...}'

Or without installing:

python3 -m src.cli --input '{"writeKey":"...", ...}'

Input Format

{
  "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
  }
}

Note: Python is a server-side SDK — there is no CDN settings fetch, so cdnHost does not apply.

Output Format

{ "success": true, "sentBatches": 1 }

On failure:

{ "success": false, "error": "description", "sentBatches": 0 }