downtest

package module
v0.0.0-...-9eab3b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2014 License: GPL-3.0 Imports: 6 Imported by: 0

README

downtest

Run tests for the known downstream consumers of a Go package.

Given the import path of a Go package, downtest queries GoDoc.org for the list of all other packages known to import that package. Each of these downstream consumer packages is tested by running go get then go test.

When the tests are complete a summary of results is printed. Optionally, the summary can be output as JSON. If all tests passed, downtest quits with exit code 0; if there were any failures, it quits with exit code 1.

Status

Build Status Build Status Coverage Status

Works okay. Needs more/better tests. Please feel free to submit new tests and/or features via pull request!

Usage

$ go get github.com/jmcvetta/downtest/downtest

$ downtest github.com/jmcvetta/napping
Running tests...
    github.com/GitbookIO/go-gitbook-api/client                               FAIL
    github.com/Mischanix/jukebox-back                                        pass
    github.com/anupcshan/neoism                                              pass
    github.com/jmcvetta/napping/examples/github_auth_token                   pass
    github.com/jmcvetta/napping/examples/httpbin                             pass
    github.com/jmcvetta/neoism                                               pass
    github.com/jmcvetta/rapportive                                           pass
    github.com/jmcvetta/stormpath                                            FAIL
    github.com/mostafah/mandrill                                             pass
    github.com/pierot/mandrill                                               pass
    github.com/piethis/cli/pie                                               pass
    github.com/srom/neoism                                                   FAIL
    github.com/wmluke/translate                                              FAIL
    github.com/yookoala/restit                                               pass

Passed 10 / 14 downstream tests.

downtest knows nothing about the test requirements of downstream packages. In the example above some tests are failing because they require an environment variable to be set. You may need to setup the environment, databases, etc before running downtest. Use flag -v to see the output of the tests as they run.

Tests are run in the context of the current $GOPATH.

Documentation

Automatically generated API documentation for package downtest can be found at GoDoc or Go Walker.

Options for the command line tool can be listed with the standard help flag:

$ downtest -h
Usage of downtest:
downtest [options] import_path
  (where import_path is the full import path of a Go package)
  -j=false: JSON output
  -u=true: Update packages with "go get -u"
  -v=false: Verbose

License

This is Free Software, released under the terms of the GPL v3.

Documentation

Overview

Package downtest runs the tests on all downstream consumers of a package, as known to GoDoc.org.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

type Package struct {
	ImportPath string
	Importers  []string
	Passed     map[string]bool
	Verbose    bool
	Update     bool
}

A Package is a module of Go code identified by its import path.

func NewPackage

func NewPackage(importPath string) (*Package, error)

NewPackage prepares a package for downstream testing by looking up its importers.

func (*Package) LookupImporters

func (p *Package) LookupImporters() error

LookupImporters gets the import paths of all downstream packages known by GoDoc.org to import this Package.

func (*Package) RunTests

func (p *Package) RunTests() error

RunTests runs "go test" on downstream packages.

Directories

Path Synopsis
Command line tool to run the tests on all downstream consumers of a package.
Command line tool to run the tests on all downstream consumers of a package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL