ram

command module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README ΒΆ

Ram 🐏 β€” a golang opiniated continuous testing tool

This is a very opiniated Β« continuous testing Β» tool for =Go=. In a nutshell it does : watch a folder (gopath or not…) and execute tests when file changes.

It supports:

  • changing code in a package will only re-run tests on this package
  • changing a test code, it will only re-run that test

Install

go get -u go.sbr.pm/ram

Examples

On knative/build-pipeline πŸŽ‰

$ ram -d ./pkg -d ./cmd -- -v
 INFO Watching directories: ./pkg, pkg/apis, pkg/apis/pipeline, pkg/apis/pipeline/v1alpha1, pkg/client, pkg/client/clientset, pkg/client/clientset/versioned, pkg/client/informers, pkg/client/informers/externalversions, pkg/client/listers, pkg/client/listers/pipeline, pkg/errors, pkg/foo, pkg/logging, pkg/reconciler, pkg/reconciler/testing, pkg/reconciler/v1alpha1, pkg/reconciler/v1alpha1/pipeline, pkg/reconciler/v1alpha1/pipelinerun, pkg/reconciler/v1alpha1/taskrun, pkg/system, ./cmd/, cmd/controller, cmd/controller/kodata, cmd/kubeconfigwriter, cmd/kubeconfigwriter/kodata, cmd/webhook, cmd/webhook/kodata
 INFO Run go test -v ./${dir}
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ filewatcher β”‚ go test -v ./pkg/foo β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
=== RUN   TestBar
--- PASS: TestBar (0.00s)
=== RUN   TestFoo
--- PASS: TestFoo (0.00s)
PASS
ok      github.com/knative/build-pipeline/pkg/foo       (cached)
β”Œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ OK β”‚ pkg/foo/foo.go β”‚ 299.754067ms β”‚
β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ filewatcher β”‚ go test -v ./pkg/foo -test.run ^TestFoo$ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
=== RUN   TestFoo
--- PASS: TestFoo (0.00s)
PASS
ok      github.com/knative/build-pipeline/pkg/foo       (cached)
β”Œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ OK β”‚ pkg/foo/foo_test.go β”‚ 255.015843ms β”‚
β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ filewatcher β”‚ go test -v ./pkg/foo -test.run ^TestBar$ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
=== RUN   TestBar
--- PASS: TestBar (0.00s)
PASS
ok      github.com/knative/build-pipeline/pkg/foo       (cached)
β”Œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ OK β”‚ pkg/foo/bar_test.go β”‚ 258.800903ms β”‚
β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Usage

See ram --help

Credits

Huge props to @dnephin for filewatcher πŸ€—

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis

Jump to

Keyboard shortcuts

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