Skip to content
πŸš€πŸŒ A simple end-to-end testing framework for Go
Branch: master
Clone or download
abraithwaite Merge pull request #5 from segmentio/allow-duplicates
orbital: allow duplicate test cases
Latest commit ff1ae43 Dec 19, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci inital commit Sep 6, 2018
example
orbital
webhook typo fixes Oct 5, 2018
.gitignore inital commit Sep 6, 2018
Gopkg.lock examples: add example of usage Sep 11, 2018
Gopkg.toml inital commit Sep 6, 2018
LICENSE inital commit Sep 6, 2018
Makefile
README.md Merge pull request #2 from frozzare/patch-1 Oct 11, 2018

README.md

orbital

Build GoDoc Go Report Card License

Orbital is a test framework which enables a developer to write end to end tests just like one would writing unit tests. We do this by effectively copying the testing.T API and registering tests to be run periodically on a configured schedule.

This package is not yet API stable. Use with the understanding that it might change as time goes on.

motivation

Writing tests should be easy. This includes oft-neglected end-to-end tests which provide arguably the most value. End to end tests can be used for functional verification before a release, alerts when your site isn't behaving correctly, or simply just providing metrics about your site or service.

usage

The goal is to make writing end-to-end tests simple and to take the effort out of building these systems. To enable that, a number of packages are provided to aid in this effort. The webhook package provides a simple way to receive notifications of received events. With those packages together, we can write elegant tests like the following.

type Harness struct {
	RouteLogger *webhook.RouteLogger
}

func (h *Harness) OrbitalSmoke(ctx context.Context, o *orbital.O) {
	s := sender{APIKey: "super-private-api-key"}
	// Send request to API for handling
	id := s.send([]byte(tmpl))

	// tell the webhook we're waiting to receive this message
	err := h.RouteLogger.Sent(id)
	if err != nil {
		o.Errorf("%{error}v", err)
		return
	}
	// Cleanup
	defer h.RouteLogger.Delete(id)

	// wait for this message to be received by the webhook
	_, err = h.RouteLogger.Wait(ctx, id)
	if err != nil {
		o.Errorf("%{error}v", err)
		return
	}
}
You can’t perform that action at this time.