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
go get -u github.com/vdemeester/ram
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 β
ββββββ΄ββββββββββββββββββββββ΄βββββββββββββββ
See ram --help
Huge props to @dnephin for filewatcher
π€