Skip to content

Add e2e-cli for E2E testing#279

Open
MichaelGHSeg wants to merge 4 commits intomasterfrom
add-e2e-cli
Open

Add e2e-cli for E2E testing#279
MichaelGHSeg wants to merge 4 commits intomasterfrom
add-e2e-cli

Conversation

@MichaelGHSeg
Copy link
Copy Markdown
Contributor

Summary

  • Adds e2e-cli/ — a Ruby CLI that reads a JSON event sequence via --input, sends events through Segment::Analytics::Client, and outputs {"success": true/false, "sentBatches": N} to stdout
  • Supports all six event types: track, identify, page, screen, alias, group
  • Loads the SDK directly from ../lib via $LOAD_PATH — no gem install required
  • Works around a bug in Transport#initialize where options[:ssl] ||= SSL silently overrides ssl: false with true; fixed by stripping :ssl before super and force-setting @http.use_ssl afterward
  • Adds .github/workflows/e2e-tests.yml and publish-e2e-cli.yml
  • Restricts e2e-config.json to basic test suite

Test plan

  • ruby e2e-cli/main.rb --input '{"writeKey":"...","apiHost":"...","sequences":[...]}' exits 0 and prints JSON
  • Basic E2E suite passes: cd sdk-e2e-tests && CLI_COMMAND="ruby .../main.rb" E2E_TEST_SUITES=basic npx vitest run
  • e2e-tests.yml workflow runs clean on CI

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.30%. Comparing base (167f59f) to head (f82db36).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #279   +/-   ##
=======================================
  Coverage   45.30%   45.30%           
=======================================
  Files          12       12           
  Lines         479      479           
=======================================
  Hits          217      217           
  Misses        262      262           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant