Categorygithub.com/gnur/groundgopher
modulepackage
0.0.0-20200618091544-6405d0c1fae2
Repository: https://github.com/gnur/groundgopher.git
Documentation: pkg.go.dev

# README

groundgopher

A matrix style testing tool that allows you to run code for setup.
It allows you to define multiple lists of test manipulators and validators and all permutations of these lists will be run.

If your API has 2 parameters (time and filter) and an auth header you create 3 lists of tests:

authtimefilter
nonenonenone
validcurrentsingle param
expired+5minvalid param
invalid-5mall params

And groundgopher will run 4 * 4 * 4 * = 64 tests.

glossary

groundgopher

A combination of a groundhog and a gopher. And the groundhog was chosen because of groundhog day, as it resembles API development quite well. Attempting day after day to make the subtle changes to make everything right.

variable

A variable within groundgopher is a single parameter in the request that gets manipulated by a list of manipulators.
In the table above auth is a variable, in this case a header.
A variable is always a list of cases, but it is possible that a variable only has a single element

case

A case is a single element in a variable list. A case consists of a setup function and a validator function.

setup

The setup function manipulates the raw http request to make the required changes. For the auth variable of the example it will set a header (or not) to a certain value.

validator

The validator will validate the raw http response. In the expired case above, it will verify that the response is a 403 and that the body contains an error message.
It always returns a result

result

A result always includes wether the request was valid and if it isn't, it also includes the reason.

run

A run is the unique combination of a single case for every variable. It also includes the result and duration.

report

The report contains all the runs and also the outcome (false if any run failed)

TODO

  • add examples

acknowledgements

cartesian.go was heavily inspired (copied) from https://github.com/schwarmco/go-cartesian-product, thanks Joachim Swarm

# Functions

Iter takes interface-slices and returns a channel, receiving cartesian products.
New returns a new gopher to run your tests.
WithHost sets the hostname of the API you want to test.
WithVerbose toggles the optional verbose output.
WithWorkers allows you to set the maximum number of parallel requests.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author