Skip to content
CLI Tool to exercise End to End Tests for any Segment library.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.buildscript
.circleci
cmd
fixtures
webhook
.gitignore
Gopkg.lock
Gopkg.toml
Makefile
README.md
RELEASING.md
bindata.go
checker.go
checker_test.go
invoker.go
pick.go
producer.go
tester.go
testrun.go

README.md

library-e2e-tester

A CLI testing tool that sends events to Segment and verifies events are received by a webhook connected to Segment.

Usage

The tester is used as follows:

./tester -segment-write-key='...' -webhook-auth-username='...' -webhook-bucket='...' -path='...'

The tester will invoke the library CLI with some fixtures, and verify that events appeared in a connected webhook.

For a library to be tested by this tester, the library must provide a CLI interface that conforms to the contract enforced by the tester:

analytics --type=<type>
          --writeKey=<writeKey>
          --userId=<userId>
          [--event=<event> --properties=<properties>] # Track
          [--name=<name> --properties=<properties>] # Page/Screen
          [--traits=<traits>] # Identify
          [--groupId=<groupId> --traits=<traits>] # Group

The setup must be done manually:

  1. Create a Segment workspace and project. Note the writeKey of the project.
  2. Create a Webhook bucket. Note the Webhook bucket ID and Webhook auth username.
  3. Add the Webhook bucket as a Segment webhook destination.

tester

The Webhook API is documented on SwaggerHub.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.