CLI for testing and coverage of Go projects.
The aim is to provide a better testing and reporting experience compared to the standard testing tools of Golang.
Shiraz is a standalone CLI. You can install it globally by running
go install github.com/vieolo/shiraz@latestAfter the install, the CLI would be available using shiraz command
test: Runs the unit tests of the project. You can provide a test command in the config file (defaults togo test -v ./...). Thetestparses the output and you can select the type of output in the config file.report: Runs the tests and generates a HTML coverage report of your project in thecoverageFolderPathof the config file. If no path is explicitly provided, the files are generated at./coveragefolder.
You can define the configuration of your project by creating a shiraz.json in your main directory. This file allows you to save your preferences.
All fields in the shiraz.json are optional. Here are the possible fields.
testcommand: The test command to be used when calling thetestcmd. (defaults togo test -v ./...)output: options are [pkgname,testname] (defaults topkgname)
projectPath: The path to the go project. Useful if the config file is not in the project being tested.coverageFolderPath: The path to the folder where the coverage files are generated and saved atenv: The environmental variables to be added when running the test command.ignore: An array of files of folders you wish to ignore from the report. You need to include the package name as well. e.g.github.com/example/dir_1orgithub.com/example/dir_2/file_1.go