Skip to content

Add e2e-cli for E2E testing#250

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

Add e2e-cli for E2E testing#250
MichaelGHSeg wants to merge 3 commits intomasterfrom
add-e2e-cli

Conversation

@MichaelGHSeg
Copy link
Copy Markdown
Contributor

Summary

  • Adds e2e-cli/ — a standalone PHP CLI that reads a JSON event sequence via --input, sends events through the real Segment\Client, and outputs {"success": true/false, "sentBatches": N} to stdout
  • Supports all six event types: track, identify, page, screen, alias, group
  • Introduces E2eLibCurl subclass to inject http:// protocol for the mock test server (the base LibCurl hardcodes https:// with no option to override)
  • Adds .github/workflows/e2e-tests.yml and publish-e2e-cli.yml
  • Restricts e2e-config.json to basic test suite

Test plan

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

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