Testify

Testify package in Go is a popular and widely used library that extends the standard Go testing package, providing a more expressive and convenient API for writing unit tests. It offers a comprehensive set of tools to simplify testing in Go applications. Gotestsum package can generate standard format JUnit-style XML files which can be submited to Testfiesta or Testrail using taco truck cli. You just need to install the popular Go testify , Gotestsum and install tacotruck cli or use Github action. Check out simple testify example.
Configuration
To generate the XML test result, see the following steps:
1. Install gotestsum (only needed once)
go install gotest.tools/gotestsum@latestMake sure ~/go/bin is in your PATH
export PATH=$PATH:~/go/binGenerate JUnit XML report
gotestsum --junitfile test-results.xml -- ./test/...Install Tacotruck CLI
$ npm install -g @testfiesta/tacotruckSubmit test results
tacotruck testfiesta \
run:submit \
--token testfiesta_... \
--handle orgHandle \
--project projectKey \
--name runName \
--data results-path/*.xmlGithub Action
name: Go Tests with Testify
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 📦 Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.24.2"
- name: 📦 Install dependencies
run: go mod download
- name: 📦 Install gotestsum
run: |
go install gotest.tools/gotestsum@latest
export PATH=$PATH:~/go/bin
- name: 🧪 Run tests
run: gotestsum --junitfile test-results.xml -- ./test/...
- name: Report Results
uses: testfiesta/tacotruck-action@v1
with:
provider: testfiesta
handle: handle
project: project
run-name: Go Testify testing CI run
Support and Resources
Last updated