Giter VIP home page Giter VIP logo

test-result's Introduction

test-result CLI

The test-result CLI enhances the visibility and readability of Go test results by parsing JSON formatted output from the go test command. It provides a streamlined view of test outcomes, making it easier to understand test results at a glance. This tool is particularly useful for developers looking to quickly assess the status of their tests in continuous integration pipelines or local development environments.

example

Features

  • JSON Parsing: Directly parses JSON output from go test -json ..., providing a clear and structured display of test results.
  • Flexible Input: Supports input from both standard input (stdin) and files, allowing for versatility in how test results are fed into the tool.

Installation

go install github.com/komase/test-result

Usage

To use test-result, you can pipe the output of go test directly into it or specify a file containing the JSON output from previous go test executions.

From Standard Input (stdin)

go test -v -json ./... | test-result

From a File

go test -v -json ./... > results.json
test-result -f results.json

Command Line Options

-a	All (pass, fail, skip) results are output.
-c  If you want to display in color even in a CI environment, please add the -c option.
-f string
    	Filename of the file containing the output from Go tests.
-v	Display the output of Go tests to stdout.

GitHub Actions

jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - name: set up go
        uses: actions/setup-go@v4
      - name: checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
          persist-credentials: false
          ref: ${{ github.head_ref }}
      - name: install test-result
        run: go install github.com/komase/test-result
      - name: run tests
        run: |
          go test -v -json ./... | test-result -c -a -v

test-result's People

Contributors

komase avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.