Spawn your program from its TestMain for end-to-end tests
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
README.md
spawn.go

README.md

spawn

A utility package that makes writing end-to-end tests for Go servers easier.

It essentially spawns your program from its TestMain, so that you can interact with it from your tests.

For usage instructions refer to the examples.

Rationale

Writing an end-to-end test for a server in Go typically involves:

  1. compiling the server
  2. spinning up the binary
  3. communicating with it somehow from the tests
  4. shut the server down

This package makes the above steps easy to do right from within the Go tests of the server.