GithubHelp home page GithubHelp logo

isabella232 / orbital-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from segmentio/orbital

0.0 0.0 0.0 30 KB

๐Ÿš€๐ŸŒ A simple end-to-end testing framework for Go

License: MIT License

Go 97.30% Makefile 2.70%

orbital-2's Introduction

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
	}
}

orbital-2's People

Contributors

abraithwaite avatar tysonmote avatar frozzare avatar depapp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.