Enrich `go test` outputs with text decorations.

Overview

richgo

Rich-Go will enrich go test outputs with text decorations

PkgGoDev Go Report Card Coverage Status Release

asciicast

Installation

(go get):

go get -u github.com/kyoh86/richgo

(homebrew):

brew tap kyoh86/tap
brew install richgo

(asdf):

asdf plugin add richgo
asdf install richgo 0.3.6

Usage

Basic

richgo test ./...

In an existing pipeline

If your build scripts expect to interact with the standard output format of go test (for instance, if you're using go-junit-report), you'll need to use the testfilter subcommand of richgo.

For example:

go test ./... | tee >(richgo testfilter) | go-junit-report

This will "tee" the output of the standard go test run into a richgo testfilter process as well as passing the original output to go-junit-report.

Note that at some point this recommendation may change, as the "go test" tool may learn how to produce a standard output format golang/go#2981 that both this tool and others could rely on.

alias

You can define alias so that go test prints rich outputs:

  • bash: ~/.bashrc
  • zsh: ~/.zshrc
alias go=richgo

Configure

Configuration file paths

It's possible to change styles with the preference file. Rich-Go loads preferences from the files in the following order.

  • ${CWD}/.richstyle
  • ${CWD}/.richstyle.yaml
  • ${CWD}/.richstyle.yml
  • ${GOPATH}/.richstyle
  • ${GOPATH}/.richstyle.yaml
  • ${GOPATH}/.richstyle.yml
  • ${GOROOT}/.richstyle
  • ${GOROOT}/.richstyle.yaml
  • ${GOROOT}/.richstyle.yml
  • ${HOME}/.richstyle
  • ${HOME}/.richstyle.yaml
  • ${HOME}/.richstyle.yml

Setting the environment variable RICHGO_LOCAL to 1, Rich-Go loads only ${CWD}/.richstyle*.

Configuration file format

Now Rich-Go supports only YAML formatted.

# Type of the label that notes a kind of each lines.
labelType: (long | short | none)

# Style of "Build" lines.
buildStyle:
  # Hide lines
  hide: (true | false)
  # Bold or increased intensity.
  bold: (true | false)
  faint: (true | false)
  italic: (true | false)
  underline: (true | false)
  blinkSlow: (true | false)
  blinkRapid: (true | false)
  # Swap the foreground color and background color.
  inverse: (true | false)
  conceal: (true | false)
  crossOut: (true | false)
  frame: (true | false)
  encircle: (true | false)
  overline: (true | false)
  # Fore-color of text
  foreground: (#xxxxxx | rgb(0-256,0-256,0-256) | rgb(0x00-0xFF,0x00-0xFF,0x00-0xFF) | (name of colors))
  # Back-color of text
  background: # Same format as `foreground`

# Style of the "Start" lines.
startStyle:
  # Same format as `buildStyle`

# Style of the "Pass" lines.
passStyle:
  # Same format as `buildStyle`

# Style of the "Fail" lines.
failStyle:
  # Same format as `buildStyle`

# Style of the "Skip" lines.
skipStyle:
  # Same format as `buildStyle`

# Style of the "File" lines.
fileStyle:
  # Same format as `buildStyle`

# Style of the "Line" lines.
lineStyle:
  # Same format as `buildStyle`

# Style of the "Pass" package lines.
passPackageStyle:
  # Same format as `buildStyle`

# Style of the "Fail" package lines.
failPackageStyle:
  # Same format as `buildStyle`

# A threashold of the coverage
coverThreshold: (0-100)

# Style of the "Cover" lines with the coverage that is higher than coverThreshold.
coveredStyle:
  # Same format as `buildStyle`

# Style of the "Cover" lines with the coverage that is lower than coverThreshold.
uncoveredStyle:
  # Same format as `buildStyle`

# If you want to delete lines, write the regular expressions.
removals:
  - (regexp)
# If you want to leave `Test` prefixes, set it "true".
leaveTestPrefix: (true | false)

Line categories

Rich-Go separate the output-lines in following categories.

  • Build:
    When the Go fails to build, it prints errors like this:

    # github.com/kyoh86/richgo/sample/buildfail
    sample/buildfail/buildfail_test.go:6: t.Foo undefined (type testing.T has no field or method Foo)
  • Start:
    In the top of test, Go prints that name like this:

    === RUN   TestSampleOK/SubtestOK
  • Pass:
    When a test is successed, Go prints that name like this:

        ---PASS: TestSampleOK/SubtestOK
  • Fail:
    When a test is failed, Go prints that name like this:

    --- FAIL: TestSampleNG (0.00s)
    sample_ng_test.go:9: It's not OK... :(
  • Skip:
    If there is no test files in directory or a test is skipped, Go prints that path or the name like this:

    --- SKIP: TestSampleSkip (0.00s)
    sample_skip_test.go:6:
    

? github.com/kyoh86/richgo/sample/notest [no test files]

  • PassPackage:
    When tests in package are successed, Go prints just:

    PASS
  • Fail:
    When a test in package are failed, Go prints just:

    FAIL
  • Cover:
    If the coverage analysis is enabled, Go prints the coverage like this:

    === RUN   TestCover05
    

--- PASS: TestCover05 (0.00s) PASS coverage: 50.0% of statements ok github.com/kyoh86/richgo/sample/cover05 0.012s coverage: 50.0% of statements

Each categories can be styled seperately.

Label types

  • Long:

    • Build: "BUILD"
    • Start: "START"
    • Pass: "PASS"
    • Fail: "FAIL"
    • Skip: "SKIP"
    • Cover: "COVER"
  • Short:

    • Build: "!!"
    • Start: ">"
    • Pass: "o"
    • Fail: "x"
    • Skip: "-"
    • Cover: "%"
  • None: Rich-Go will never output labels.

Default

labelType: long
buildStyle:
  bold: true
  foreground: yellow
startStyle:
  foreground: lightBlack
passStyle:
  foreground: green
failStyle:
  bold: true
  foreground: red
skipStyle:
  foreground: lightBlack
passPackageStyle:
  foreground: green
  hide: true
failPackageStyle:
  bold: true
  foreground: red
  hide: true
coverThreshold: 50
coveredStyle:
  foreground: green
uncoveredStyle:
  bold: true
  foreground: yellow
fileStyle:
  foreground: cyan
lineStyle:
  foreground: magenta

Overriding colorization detection

By default, richgo determines whether or not to colorize its output based on whether it's connected to a TTY or not. This works for most use cases, but may not behave as expected if you use richgo in a pipeline of commands, where STDOUT is being piped to another command.

To force colorization, add RICHGO_FORCE_COLOR=1 to the environment you're running in. For example:

RICHGO_FORCE_COLOR=1 richgo test ./... | tee test.log

Configure to resolve a conflict with "Solarized dark" theme

The bright-black is used for background color in Solarized dark theme. Richgo uses that color for "startStyle" and "skipStyle", so "START" and "SKIP" lines can not be seen on the screen with Solarized dark theme.

To resolve that conflict, you can set another color for "startStyle" and "skipStyle" in .richstyle like below.

startStyle:
  foreground: yellow

skipStyle:
  foreground: lightYellow

License

MIT License

This is distributed under the MIT License.

Issues
  • Colour output not as expected

    Colour output not as expected

    Hi 👋

    I was playing around with RichGo and am unsure whether this is a bug or not 🤔

    When running a test suite, there seems to be just one single color for all the output in one category. Like in this case everything that belongs to the FAIL category is just plain red:

    The screenshot in your readme suggests that files, line numbers, etc should have a different color. For instance, I would have expected the line indicators to be printed in magenta and the actual files in cyan.

    Am I doing something wrong?

    Thank you!

    P.S.: I am running richgo on Mac + zsh.

    opened by Freddixx 8
  • Test output whitespace mangled

    Test output whitespace mangled

    Some of our tests output wide columnar diffs when something doesn't match:

    --- FAIL: TestBuilder (0.01s)
        --- FAIL: TestBuilder/object/nested/deeper (0.01s)
            Error Trace:    diffing.go:48
        			builder_test.go:87
        			builder_test.go:31
        	Error:  	Strings are different (left is expected, right is actual):
        			(logicalplan.Evaluate) {					(logicalplan.Evaluate) {
        			  Expression: (expressions.ObjectTransform) {			  Expression: (expressions.ObjectTransform) {
        			    LHS: (expressions.Placeholder) {				    LHS: (expressions.Placeholder) {
        			      Name: (string) (len=3) "lhs"				      Name: (string) (len=3) "lhs"
        			    },								    },
    [...]
    

    Here's with richgo test:

    FAIL | Builder (0.02s)
    FAIL |       Builder/object/nested/deeper (0.01s)
      Error Trace:  diffing.go:487: 
          builder_test.go:87
          builder_test.go:31
      Error:    Strings are different (left is expected, right is actual):
         |           (logicalplan.Evaluate) {          (logicalplan.Evaluate) {
         |             Expression: (expressions.ObjectTransform) {        Expression: (expressions.ObjectTransform) {
         |               LHS: (expressions.Placeholder) {            LHS: (expressions.Placeholder) {
         |                 Name: (string) (len=3) "lhs"              Name: (string) (len=3) "lhs"
         |               },                    },
    

    This is of course completely unreadable.

    The lines are aligned with spaces, not tabs, so I don't know why it's compressing them like this.

    opened by atombender 7
  • output is not parsed if cached

    output is not parsed if cached

    First run, as you can see the lines with cached are not parsed properly

    20-12-15 13:35 % richgo test -cover -race ./pkg/...  
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/auditlog        [no test files]
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cache  (cached)        coverage: 98.4% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cache/tenant   (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cache/user     (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd    (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/gen        (cached)        coverage: 100.0% of statements
    PASS | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/gen/config 0.257s
    COVER| 72.0% [#######___]
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/gen/i18n   (cached)        coverage: 100.0% of statements
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/migrate     [no test files]
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/register   (cached)        coverage: 98.8% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/root       (cached)        coverage: 100.0% of statements
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/start       [no test files]
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/constants       [no test files]
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/currency       (cached)        coverage: 100.0% of statements
    PASS | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/db/mongo 0.826s
    COVER| 25.7% [##________]
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/db/mongo/mocks  [no test files]
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/helpers        (cached)        coverage: 82.4% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/i18n   (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/keymutex       (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/log    (cached)        coverage: 96.2% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/middleware     (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/models/mcmp    (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/settings       (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/tasks  (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/token  (cached)        coverage: 100.0% of statements
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/token/mocks     [no test files]
    

    Second run, only the lines with SKIP are parsed

    20-12-15 13:36 % richgo test -cover -race ./pkg/... 
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/auditlog        [no test files]
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cache  (cached)        coverage: 98.4% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cache/tenant   (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cache/user     (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd    (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/gen        (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/gen/config (cached)        coverage: 72.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/gen/i18n   (cached)        coverage: 100.0% of statements
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/migrate     [no test files]
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/register   (cached)        coverage: 98.8% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/root       (cached)        coverage: 100.0% of statements
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/cmd/start       [no test files]
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/constants       [no test files]
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/currency       (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/db/mongo       (cached)        coverage: 25.7% of statements
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/db/mongo/mocks  [no test files]
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/helpers        (cached)        coverage: 82.4% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/i18n   (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/keymutex       (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/log    (cached)        coverage: 96.2% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/middleware     (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/models/mcmp    (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/settings       (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/tasks  (cached)        coverage: 100.0% of statements
         | ok       github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/token  (cached)        coverage: 100.0% of statements
    SKIP | github.ibm.com/cloudMatrix-CAM/common-lib-go/pkg/token/mocks     [no test files]
    

    MacOS 11.1 (Big Sur) Go version go1.15.5 darwin/amd64 richgo is the latest (installed today from brew): kyoh86/tap/richgo: stable 0.3.3

    opened by SVilgelm 6
  • Color scheme conflict with gnome solarized dark

    Color scheme conflict with gnome solarized dark

    Hi, thanks for your great project.

    I found the default color config is conflicted with gnome solarized dark theme, many lines will not show when running test, though they are truly printed on screen(Seems like empty lines).

    Take this as example:

    START| Persist12C
         | Test (2C): basic persistence ...
         |   ... Passed
    PASS | Persist12C (5.77s)
    

    These lines can not be seen on the screen

    START| Persist12C
         | Test (2C): basic persistence ...
         |   ... Passed
    

    Only this line can be seen

    PASS | Persist12C (5.77s)
    

    And if I switched into solarized light, everything will be OK.

    opened by theidexisted 5
  • Add dual-output for compatibility with existing tools

    Add dual-output for compatibility with existing tools

    Many tools currently parse the output of go test, which means we can't just drop this helpful tool into a build pipeline without breaking things.

    Of note, there's a proposal in upstream Golang to support a standard "go test" output (https://github.com/golang/go/issues/2981) which would help this and many other tools. However this is just a "proposal" and there's no concrete timeline for implementing.

    In the meantime, the output of "go test" is the canonical source-of-truth for test runs, and many tools (including go-junit-report(https://github.com/jstemmer/go-junit-report) which I use and contribute to expect the tests runs to output their results in a specific, human-friendly format.

    In order to differentiate between output made for humans (which richgo does a great job at doing) and output for machines (which go test currently does, although it's currently both for-machine and for-human, and it isn't very great for humans), I'd like to augment richgo to support outputting both: a human-friendly mode, and a machine-friendly mode.

    In the short term, the machine-friendly mode will simply be the input we get from running "go test" unmunged. In the future, it will probably be go test -json or whatever the upstream proposal lands on, which will make everybody's job easier.

    The primary changes proposed are to implement two flags (and optionally environment variables):

    • the output path to send the human-friendly version to (default: os.Stdout)
    • the output path to send the machine-friendly version to (currently ioutil.Discard)

    note that rather than hard-coding paths for defaults, will need to do some portability things to make sure we don't hardcode this as /dev/stdout and instead use the more portable os.Stdout and ioutil.Discard istead of /dev/null -- none of this will be difficult but writing it down here so I don't forget it.

    Then somebody could run this tool using linux FIFOS (totally untested):

    tmpdir=$(mkdtemp -d)
    outfifo="${tmpdir}/MYFIFO
    mkfifo a=rw "${outfifo}"
    go-junit-report < ${outfifo} > junit.xml
    richgo test --machine-friendly-output "${outfifo}"
    

    And on their console they would have the default, nice, colorized output on os.Stdout, but go-junit-report would be parsing the "machine-friendly" version.

    References #3

    opened by ascandella 5
  • Richgo hangs after the test finish with a failure

    Richgo hangs after the test finish with a failure

    In the https://github.com/kubermatic/kubecarrier project we're using richgo for parsing the test output:

    https://github.com/kubermatic/kubecarrier/blob/e2e-explorations/hack/.e2e-test.sh

    kubectl kubecarrier e2e-test run --test.v --test.failfast --test-id=${TEST_ID} | richgo testfilter
    

    Sometimes after the failing test, the richgo hangs. Here's the output from stdout/err:

    ...
         |     --- FAIL: Integration/apiserver (65.18s)
         |         --- PASS: Integration/apiserver/account-service (1.39s)
         |         --- PASS: Integration/apiserver/region-service (2.20s)
         |         --- PASS: Integration/apiserver/provider-service (2.58s)
         |         --- FAIL: Integration/apiserver/offering-service (60.02s)
         |         --- FAIL: Integration/apiserver/instance-service (137.03s)
    FAIL
    

    and after running ps axf I see only richgo is still running; thus my own testing binary producing output has closed.

    486497 pts/6    Ss     0:06              \_ /usr/bin/zsh -i
     558511 pts/6    S+     0:00              |   \_ make e2e-test
     569591 pts/6    S+     0:00              |       \_ /bin/bash ./hack/.e2e-test.sh
     569593 pts/6    Sl+    0:00              |           \_ richgo testfilter
     569602 pts/6    S+     0:00              |               \_ cat -
    

    After stracing it:

     ▲ ~/Desktop/kubecarrier sudo strace -fp 569593                                                                                                                                                                                                                                                                                                                           
    strace: Process 569593 attached with 5 threads
    [pid 569601] futex(0xc000074148, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
    [pid 569600] futex(0xc00004e848, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
    [pid 569599] epoll_pwait(5,  <unfinished ...>
    [pid 569598] restart_syscall(<... resuming interrupted read ...> <unfinished ...>
    [pid 569593] waitid(P_PID, 569602, 
    

    Now I have two questions:

    • why does it hang?
    • Why it's executing cat - command

    Is there anything more I could do to debug this issue?

    opened by nmiculinic 4
  • Testfilter does not work

    Testfilter does not work

    I would like to avoid using richgo as the primary entrypoint for my tests (I have my reasons) so I was happy to see that I can just pass an output to richgo. Unfortunately it doesn't do any colorization.

    I tried the following:

    $ go test -v ./pkg/... | tee >(richgo testfilter)
    $ go test -v ./pkg/... | richgo testfilter
    $ go test -v ./pkg/... | tee >(richgo testfilter) | cat
    

    What am doing wrong?

    (Note: normally I run a makefile to execute tests, which produces the exact same output as go test, so I doubt it's an issue)

    I use macOS with iTerm and zsh

    opened by sagikazarmark 4
  • Extraneous newlines are added for some commands

    Extraneous newlines are added for some commands

    I wouldn't expect the output of richgo version and go version to be different at all, but they are:

    richgo - master! ❯ ./richgo version
    go version go1.8.1 darwin/amd64
    
    
    richgo - master! ❯ go version
    go version go1.8.1 darwin/amd64
    richgo - master! ❯
    

    This appears to be us manually adding \n characters in Close() on *stream

    richgo - master! ❯ git --no-pager diff
    diff --git i/editor/editor.go w/editor/editor.go
    index e702e15..6074485 100644
    --- i/editor/editor.go
    +++ w/editor/editor.go
    @@ -2,6 +2,7 @@ package editor
    
     import (
            "bytes"
    +       "fmt"
            "io"
     )
    
    @@ -40,6 +41,7 @@ func (s *stream) writeLines(lines [][]byte) error {
     }
    
     func (s *stream) Write(b []byte) (int, error) {
    +       fmt.Println("Write")
            lines := bytes.Split(append(s.buffer, b...), []byte("\n"))
            s.buffer = lines[len(lines)-1]
            lines = lines[:len(lines)-1]
    @@ -50,6 +52,7 @@ func (s *stream) Write(b []byte) (int, error) {
     }
    
     func (s *stream) Close() error {
    +       fmt.Println("Close stream")
            lines := bytes.Split(s.buffer, []byte(`\n`))
            s.buffer = nil
            if err := s.writeLines(lines); err != nil {
    
    richgo - master! ❯ ./richgo version
    Write
    go version go1.8.1 darwin/amd64
    Close stream
    
    Close stream
    
    richgo - master! ❯
    

    The double-close seems weird. Not sure if this is already on your radar. Obviously there are a lot of potential solutions, wanted to hear your thoughts before opening a PR.

    wontfix 
    opened by ascandella 4
  • Is there a way to know richgo version ?

    Is there a way to know richgo version ?

    Hi,

    I'm using richgo for a while now, but I'm facing a small issue I would like to raise.

    I'm struggling to get the richgo version on the multiple machines I'm using.

    So when I doubt if richgo is up-to-date on the machine I am, I'm installing again from latest tag.

    Could you consider something to provide the richgo version ?

    I don't know why it's not available, may be because richgo is simple a "proxy" to go command, so adding flag may conflict with golang binary.

    I'm not talking about having information about richgo with richgo version but may be something richgo --richgo-version

    question 
    opened by ccoVeille 3
  • Add one line summary to count tests passed/failed/skipped

    Add one line summary to count tests passed/failed/skipped

    Hello, thanks for your tool :) Very appreciable :)

    Do you think it would be possible to add a one line summary to count tests that passed/failed/skipped at the end? Coming from other languages, this is something I miss in go test.

    If you're interested, I could try to open a PR if you guide me a bit.

    Thanks :)

    wontfix 
    opened by jjanvier 3
  • bug: Homebrew: Calling bottle :unneeded is deprecated

    bug: Homebrew: Calling bottle :unneeded is deprecated

    brew upgrade repots a warning:

    Warning: Calling bottle :unneeded is deprecated! There is no replacement.
    Please report this issue to the kyoh86/tap tap (not Homebrew/brew or Homebrew/core):
      /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/richgo.rb:9
    

    Fix is very trivial, you just need to release new version, gorelease already has a fix https://github.com/goreleaser/goreleaser/issues/2595

    opened by SVilgelm 2
  • Also colorize `go vet ./...`

    Also colorize `go vet ./...`

    Vet can get pretty verbose with package-prefixed type names as well as file paths. Colors for file paths, package names and paths would be a great start :)

    opened by fenollp 0
  • I noticed both main and master branch exist

    I noticed both main and master branch exist

    git branch -lvr 'upstream/ma*
      upstream/main   78deda9 update golangci-lint action
      upstream/master f668684 change email address
    

    I would suggest deleting the master branch to avoid confusion.

    git branch -d master
    git push origin --delete master
    
    bug 
    opened by mojotx 0
  • Update Go version and Makefile

    Update Go version and Makefile

    I updated the go.mod file to reference Go 1.17 instead of Go 1.13. I also replaced the call to git vertag with git describe --tags --abbrev=0.

    This project is nice for testing!

    opened by mojotx 0
  • bug: brew install doesn't work

    bug: brew install doesn't work

    Summary

    Look that is bug in formula for homebrew.

    Details

    To reproduce

    Steps to reproduce the behavior:

    1. Use terminal
    2. Run brew install kyoh86/tap/richgo

    Expected behavior

    A clear and concise description of what you expected to happen.

    Screenshots

    $ brew install kyoh86/tap/richgo                                                                                                                                                                                                                                                                                 
    ==> Auto-updated Homebrew!
    Updated 1 tap (homebrew/core).
    Running `brew update --auto-update`...
    
    You have 1 outdated formula installed.
    You can upgrade it with brew upgrade
    or list it with brew outdated.
    
    ==> Tapping kyoh86/tap
    Cloning into '/opt/homebrew/Library/Taps/kyoh86/homebrew-tap'...
    remote: Enumerating objects: 769, done.
    remote: Counting objects: 100% (385/385), done.
    remote: Compressing objects: 100% (125/125), done.
    remote: Total 769 (delta 183), reused 385 (delta 183), pack-reused 384
    Receiving objects: 100% (769/769), 93.87 KiB | 2.76 MiB/s, done.
    Resolving deltas: 100% (352/352), done.
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/notifail.rb
    notifail: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/zshist.rb
    zshist: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/git-vertag.rb
    git-vertag: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/csv2xlsx.rb
    csv2xlsx: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/gordon.rb
    gordon: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/git-prompt.rb
    git-prompt: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/git-statuses.rb
    git-statuses: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/scopelint.rb
    scopelint: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/gigamoji.rb
    gigamoji: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/pyenv-upgrade.rb
    pyenv-upgrade: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/looppointer.rb
    looppointer: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/docbase.rb
    docbase: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/exportloopref.rb
    exportloopref: wrong number of arguments (given 1, expected 0)
    Error: Invalid formula: /opt/homebrew/Library/Taps/kyoh86/homebrew-tap/Formula/git-branches.rb
    git-branches: wrong number of arguments (given 1, expected 0)
    Error: Cannot tap kyoh86/tap: invalid syntax in tap!
    

    Context

    $ brew config                                                                                                                                                                                                                                                                                                    
    HOMEBREW_VERSION: 3.5.2
    ORIGIN: https://github.com/Homebrew/brew
    HEAD: fba051f98f609634ae4392d0053ddfc627f8cdb3
    Last commit: 2 days ago
    Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
    Core tap HEAD: be16fff5da31587324df4e40979ed8c2edb87b58
    Core tap last commit: 19 minutes ago
    Core tap branch: master
    HOMEBREW_PREFIX: /opt/homebrew
    HOMEBREW_CASK_OPTS: []
    HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
    HOMEBREW_EDITOR: code
    HOMEBREW_GITHUB_API_TOKEN: set
    HOMEBREW_MAKE_JOBS: 10
    Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
    CPU: 10-core 64-bit arm_firestorm_icestorm
    Clang: 13.1.6 build 1316
    Git: 2.36.1 => /opt/homebrew/bin/git
    Curl: 7.79.1 => /usr/bin/curl
    macOS: 12.4-arm64
    CLT: 13.4.0.0.1.1651278267
    Xcode: N/A
    Rosetta 2: false
    
    bug 
    opened by abtris 0
  • Richgo testfilter will not create build for failing tests

    Richgo testfilter will not create build for failing tests

    Hi,

    i'm trying to use richgo together with go-junit-report and use your recommendation but there is drawback i have found. With the command

    go test ./... | tee >(richgo testfilter) | go-junit-report
    

    your build will not fail (return status == 0). This is bit weird as with this step we don't have the option to stop build broken packages..

    So far i have the following workaround

    go test ./... | tee >(richgo testfilter) | go-junit-report; exit "$${PIPESTATUS[0]}"
    

    Maybe this can be added to the docs?

    help wanted 
    opened by eloo 1
Releases(v0.3.10)
Owner
Kyoichiro Yamada
Working in @wacul. Lovin' Go, C#, Perl and Shell
Kyoichiro Yamada
A minimalist Go PDF writer in 1982 lines. Draws text, images and shapes. Helps understand the PDF format. Used in production for reports.

one-file-pdf - A minimalist PDF generator in <2K lines and 1 file The main idea behind this project was: "How small can I make a PDF generator for it

Ali Bala 441 May 15, 2022
A modern and intuitive terminal-based text editor

micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals.

Zachary Yedidia 19.7k Jun 26, 2022
The new home of the CUE language! Validate and define text-based and dynamic configuration

The CUE Data Constraint Language Configure, Unify, Execute CUE is an open source data constraint language which aims to simplify tasks involving defin

null 2.7k Jun 30, 2022
Tool to easily rename or move a bunch of files with a text editor of your choice

batch-rename With batch-rename you can utilize your favorite text editor to rename or move a bunch of files at once. It doesn't come with any features

David Vogel 0 Oct 13, 2021
Phalanx is a cloud-native full-text search and indexing server written in Go built on top of Bluge that provides endpoints through gRPC and traditional RESTful API.

Phalanx Phalanx is a cloud-native full-text search and indexing server written in Go built on top of Bluge that provides endpoints through gRPC and tr

Minoru Osuka 232 Jun 30, 2022
Insert German umlauts in the clipboard text.

Trying to write German on an English keyboard proves to be hard. Entering umlauts like ä and ß is not easy. This program will insert umlauts in your c

null 0 Feb 7, 2022
Knit is an inline code generation tool that combines the power of Go's text/template package with automatic spec file loading.

Knit Knit is an inline code generation tool that combines the power of Go's text/template package with automatic spec file loading. Example openapi: "

Tyler 3 Apr 6, 2022
James is your butler and helps you to create, build, debug, test and run your Go projects

go-james James is your butler and helps you to create, build, debug, test and run your Go projects. When you often create new apps using Go, it quickl

Pieter Claerhout 50 Mar 8, 2022
Automatically generate Go test boilerplate from your source code.

gotests gotests makes writing Go tests easy. It's a Golang commandline tool that generates table driven tests based on its target source files' functi

Charles Weill 4k Jun 21, 2022
Solution to elevator test problem but this time recursive and in go

Synopsis A multi-floor building has a Lift in it. People are queued on different floors waiting for the Lift. Some people want to go up. Some people w

Alex Piemont 0 Nov 8, 2021
Implementation of the test task, chat in the goland language

Implementation of the test task, chat in the goland language

Dmitriy Fofanov 1 Dec 5, 2021
A Golang program for a colleague to help in calculating the ratio between the points obtained in a test and the corresponding evaluation in tenths.

A Golang program for a colleague to help in calculating the ratio between the points obtained in a test and the corresponding evaluation in tenths. If you have not the compiled file (.exe) you can build it with the Go compiler.

Francesco Fontana 0 Nov 15, 2021
MNC Technical Test With Golang

MNC Technical Test With Golang

Angga Suwito 0 Nov 20, 2021
A toy repo used to test the functionality of "go mod why".

Mod Why Test Discussion From a module perspective: The main module (github.com/ejweber/mod-why-test) has a single direct dependency (github.com/ejwebe

Eric Weber 1 Dec 1, 2021
Extensions for the melatonin test framework

melatonin-ext - Extensions for the melatonin test framework These packages extend melatonin to provide additional test contexts for testing various 3r

Jeff Linse 0 Nov 27, 2021
A little tool to create small QR code cards for vaccination/test proof.

Icedream's fancy vaccination/test certificate card tool This is just a tool I wrote to transform my vaccine certificate QR codes into something I can

Carl Kittelberger 0 Dec 16, 2021
Test-project - Lyrid Golang 1.x Chi Template

Lyrid Golang 1.x Chi Template Run locally with: go get go run ./main.go Open ht

pensilpatah 0 Jan 31, 2022
Go-opera-test - EVM-compatible chain secured by the Lachesis consensus algorithm

Opera EVM-compatible chain secured by the Lachesis consensus algorithm. Building

Tenderly 0 Feb 14, 2022
A project outputs Bluetooth Low Energy (BLE) sensors data in InfluxDB line protocol formatA project outputs Bluetooth Low Energy (BLE) sensors data in InfluxDB line protocol format

Intro This project outputs Bluetooth Low Energy (BLE) sensors data in InfluxDB line protocol format. It integrates nicely with the Telegraf execd inpu

Marc Venturini 1 Apr 15, 2022
Gomol is a library for structured, multiple-output logging for Go with extensible logging outputs

gomol Gomol (Go Multi-Output Logger) is an MIT-licensed structured logging library for Go. Gomol grew from a desire to have a structured logging libra

Kristin Davidson 18 Dec 20, 2021
Provides conversion from athena outputs to strongly-typed data models.

Provides conversion from athena outputs to strongly defined data models. Getting started Given the following data struct you define: type MyModel stru

Ken Timothy 4 Feb 7, 2022
Generate mega-workflows using Wappalyzer outputs and existing tech-detect

Usage Usage of ./build/generate-nuclei-templates: -clone-path string Path to clone Wappalyzer repository (default "./wappalyzer") -debug

null 5 Dec 15, 2021
Limner colorizes and transforms CLI outputs.

Limner Limner colorizes and transforms CLI outputs. Motivation When playing with kubectl, I sometimes found it hard to extract the information I neede

Mercurio 99 Mar 4, 2022
Ditto is a CLI testing tool that helps you verify if multiple HTTP endpoints have the same outputs.

Ditto is a CLI testing tool that helps you verify if multiple HTTP endpoints have the same outputs.

Cristopher 1 Nov 24, 2021
simple clipboard copy for complex outputs

Terminal Clipboard Different from others terminal's clipboard coppiers, this one can copy complex and interminables commands like tail -f or outputs t

Daniel Kanczuk 0 Nov 5, 2021
A tool that makes http requests and outputs the url and the content (optionally to file)

BKK Basic Crawler A tool that makes http requests and outputs the url and the content (optionally to file) How to run.. the tests go test the compiler

Jero Berlin 0 Nov 8, 2021
Calling functions by name and getting outputs by using reflect package.

Invoker A library to call (invoke) functions by taking names and sample inputs of those functions as parameters. And returns the types and values of o

null 3 Dec 20, 2021
A simple CLI tool that outputs the history of connections to Amazon EC2 instances using AWS Session Manager.

ssmh This is a simple CLI tool that outputs the history of connections to Amazon EC2 instances using AWS Session Manager. Installation brew install mi

Yoshihiro Ito 0 Dec 10, 2021
Go program that outputs a GIF with the lissajous figures using green and black

lissajousgb This is an exercise of the book The Go Programming Language, by Alan

Santiago Rodriguez 0 Dec 18, 2021