Skip to content

[RFC] Add a "go-unit-tests" hook #3

@cshamrick

Description

@cshamrick

Adding this RFC on behalf of @jduclos-bellese - we'd like to get feedback about whether we could add a go-unit-tests hook to this project. We could implement the hook similar to the go-unit-tests hook found in dnephin/pre-commit-golang, which executes a bash script like this:

#!/usr/bin/env bash
FILES=$(go list ./...  | grep -v /vendor/)

go test -tags=unit -timeout 30s -short -v ${FILES}

returncode=$?
if [ $returncode -ne 0 ]; then
  echo "unit tests failed"
  exit 1
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions