Skip to content

protogodev/dbtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbtest

Database testing made easy in Go.

Features

  1. Declarative

    Define the minimum test specification in a YAML-based DSL, then all tests can be generated automatically.

  2. Customizable

    You can specify your own Go template when generating tests.

  3. Opinionated

Installation

Make a custom build of protogo:

$ protogo build --plugin=github.com/protogodev/dbtest

Or build from a local fork:

$ protogo build --plugin=github.com/protogodev/dbtest=../my-fork
Usage
$ protogo dbtest -h
Usage: protogo dbtest <source-file> <interface-name>

Arguments:
  <source-file>       source-file
  <interface-name>    interface-name

Flags:
  -h, --help                         Show context-sensitive help.

      --out=STRING                   output filename (default "./<srcPkgName>_test.go")
      --fmt                          whether to make the test code formatted
      --spec="./dbtest.spec.yaml"    the test specification in YAML
      --tmpl=STRING                  the template to render (default to builtin template)

Examples

See examples.

Documentation

Check out the Godoc.

License

MIT

Releases

No releases published

Packages

No packages published

Languages