Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/agrea/go-test-runner

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/agrea/go-test-runner

  • v0.0.0-20171013060209-ef68316db92c
  • Source
  • Go
  • Socket score

Version published
Created
Source

Go test runner

The go-test-runner is a simple way of running lint checks (via gometalinter) and execute tests (via go test) on your projects.

If you like the project, please star it! If you feel really generous, please follow @AgreaIO on Twitter

Installation

Local installation

go get -u github.com/agrea/go-test-runner
go install github.com/agrea/go-test-runner

Running it via Docker

Below is an example command to run go-test-runner via a Docker image. Replace <PACKAGE> with your package path (like github.com/agrea/go-test-runner). Any parameters to go-test-runner can be appended to the command.

docker run -it --rm \
    -v $(pwd):/go/src/<PACKAGE> \
    agrea/go-test-runner:latest \
    go-test-runner \
        -package <PACKAGE>

Usage and configuration

Command line instructions

Usage of ./go-test-runner:
  -disable-go-test
        Disable go test execution
  -disable-gometalinter
        Disable gometalinter checks
  -go-test-flags string
        Send custom flags to go test as parameters
  -go-test-short
        Enable -short mode for go test
  -gometalinter-config string
        Path to configuration file for gometalinter
  -gometalinter-flags string
        Send custom flags to gometalinter
  -gometalinter-path string
        Path for gometalinter to lint. Set it to ./... for recursion (default ".")
  -ignore-errors
        Continue with the next check on errors
  -package string
        Package name to test
  -recursive
        Run tests recursivly
  -verbose
        Enable verbose output

Gometalinter configuration

We usually run gometalinter with a configuration file. You can specify a Gometalinter configuration file for go-test-runner to use with the -gometalinter-config parameter. Here's an example configuration:

{
  "Enable": [
    "deadcode",
    "vet",
    "gosimple",
    "goimports",
    "gofmt",
    "gocyclo",
    "golint",
    "ineffassign"
  ],
  "Install": false,
  "Deadline": "30s",
  "Test": true
}

Running all checks, even if one failed

The default behaviour for go-test-runner is to exit if a check has failed. To override that behaviour and run all checks, please provide the -ignore-errors flag.

Contributing

The go-test-runner is by no means done. It works well for most of our use cases. But if you have other use cases you'd like it to cover, please submit an issue.

If you'd like to contribute by implementing more features or fixing bugs, please don't hesitate to raise a PR. If you need any guidance, check with @sebdah or @AgreaIO, we'd love to help get you started.

License

MIT license

FAQs

Package last updated on 13 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc