Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
21a8460
Improve HTTP response handling and retry logic
MichaelGHSeg Feb 12, 2026
e4f34d0
Increase max retries from 10 to 1000
MichaelGHSeg Feb 12, 2026
8bd4163
Update segment/analytics/test/test_request.py
MichaelGHSeg Feb 12, 2026
e1ac214
Apply suggestions from code review
MichaelGHSeg Feb 18, 2026
6a10b7c
Address PR review feedback
MichaelGHSeg Feb 19, 2026
6ed8ef6
Implement unified HTTP response handling per SDD
MichaelGHSeg Feb 25, 2026
a28102f
Fix Retry-After: 0 handling and 429 re-queue guard
MichaelGHSeg Feb 25, 2026
2165298
Merge branch 'master' into response-status-updates
MichaelGHSeg Feb 25, 2026
115d124
Address PR review: catch KeyError in response parsing
MichaelGHSeg Feb 25, 2026
2474b46
Enabling retry e2e test set
MichaelGHSeg Feb 25, 2026
98df1bc
Fix Retry-After header never parsed on non-2xx responses
MichaelGHSeg Feb 26, 2026
ec0481f
Wire on_error callback in e2e-cli for failure reporting
MichaelGHSeg Feb 26, 2026
ea257f8
Consolidate backoff parameters: max retries 1000 -> 10
MichaelGHSeg Mar 4, 2026
184fe1f
Merge branch 'master' into response-status-updates
MichaelGHSeg Mar 11, 2026
12d2f08
Omit X-Retry-Count header on first attempt, send only on retries
MichaelGHSeg Mar 20, 2026
a2fd03b
Treat 2xx and 3xx status codes as success, not just 200
MichaelGHSeg May 1, 2026
f0c39a7
Merge remote-tracking branch 'origin/master' into response-status-upd…
MichaelGHSeg May 7, 2026
8c5680a
Improve e2e-cli setup: Python resolution and devbox docs
MichaelGHSeg May 7, 2026
ad198ef
Address all issues from deep code review
MichaelGHSeg May 11, 2026
211f094
Refine documentation in flush method
MichaelGHSeg May 11, 2026
a1314f8
Delete status-response-updates-deep-review.md
MichaelGHSeg May 11, 2026
9818b34
Handle Retry-After on every retryable status, including 529
MichaelGHSeg Sep 2, 2026
a09b6b6
Merge master into response-status-updates
MichaelGHSeg Sep 3, 2026
e1324dc
Stop stale rate-limit state from misrouting later errors
MichaelGHSeg Sep 3, 2026
ff63200
Tighten retry comments
MichaelGHSeg Sep 11, 2026
4242e05
Opt in to the e2e Authorization check
MichaelGHSeg Sep 17, 2026
0f0c680
Treat only 2xx as a successful upload
MichaelGHSeg Sep 22, 2026
c8a18f4
Fix a task_done leak, finish interruptible waits, use a monotonic clock
MichaelGHSeg Sep 22, 2026
ba013d2
Add release notes for the HTTP response and retry work
MichaelGHSeg Sep 22, 2026
2b1eae4
Correct the release notes on 3xx handling
MichaelGHSeg Sep 23, 2026
0af186e
Re-queue a batch interrupted mid-backoff, and parse Retry-After once
MichaelGHSeg Sep 23, 2026
0219323
Keep a non-object JSON error body non-retryable
MichaelGHSeg Sep 23, 2026
3039c4f
Revert unrelated README quote-style churn
MichaelGHSeg Sep 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve e2e-cli setup: Python resolution and devbox docs
- Resolve python via activated venv/devbox, fall back to python3
- Use $PYTHON -m pip instead of bare pip (fixes macOS/nix where pip is not on PATH)
- Add devbox setup as recommended path in README, with venv fallback instructions
  • Loading branch information
MichaelGHSeg committed May 7, 2026
commit 8c5680a2c43da8b339a56f74a71a140221c2871d
30 changes: 24 additions & 6 deletions e2e-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,35 @@

E2E test CLI for the [analytics-python](https://github.com/segmentio/analytics-python) SDK. Accepts a JSON input describing events and SDK configuration, sends them through the real SDK, and outputs results as JSON.

## Setup
## Running E2E tests

### With devbox (recommended)

```bash
# From repo root — activates Python 3.12 and installs deps automatically
devbox shell

# Then from e2e-cli dir:
./run-e2e.sh
```

### Without devbox

Requires Python 3.9+ and Node.js 18+. Using a virtualenv is strongly recommended since macOS system Python is externally managed.

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

### Override sdk-e2e-tests location

```bash
E2E_TESTS_DIR=../my-e2e-tests ./run-e2e.sh
```

## Usage
## Manual CLI usage

```bash
e2e-cli --input '{"writeKey":"...", ...}'
Expand All @@ -21,7 +39,7 @@ e2e-cli --input '{"writeKey":"...", ...}'
Or without installing:

```bash
python3 -m src.cli --input '{"writeKey":"...", ...}'
python3 src/cli.py --input '{"writeKey":"...", ...}'
```

## Input Format
Expand Down
18 changes: 15 additions & 3 deletions e2e-cli/run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#
# Run E2E tests for analytics-python
#
# Prerequisites: Python 3, pip, Node.js 18+
# Prerequisites: Node.js 18+ and one of:
# - devbox (recommended): run `devbox shell` first, then ./run-e2e.sh
# - Python 3.9+ with a virtualenv already activated
#
# Usage:
# ./run-e2e.sh [extra args passed to run-tests.sh]
Expand All @@ -17,15 +19,25 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SDK_ROOT="$SCRIPT_DIR/.."
E2E_DIR="${E2E_TESTS_DIR:-$SDK_ROOT/../sdk-e2e-tests}"

# Resolve python and pip — prefer activated venv/devbox python, fall back to python3
PYTHON="${PYTHON:-$(command -v python || command -v python3)}"
PIP="$PYTHON -m pip"

if [[ -z "$PYTHON" ]]; then
echo "Error: Python not found. Run 'devbox shell' first or activate a virtualenv."
exit 1
fi

echo "=== Building analytics-python e2e-cli ==="
echo "Using Python: $PYTHON"

# Install SDK
cd "$SDK_ROOT"
pip install -e .
$PIP install -e . -q

# Install e2e-cli
cd "$SCRIPT_DIR"
pip install -e .
$PIP install -e . -q

echo ""

Expand Down
Loading