{"id":13614248,"url":"https://github.com/vakenbolt/go-test-report","last_synced_at":"2025-04-13T18:32:32.464Z","repository":{"id":40756073,"uuid":"260062465","full_name":"vakenbolt/go-test-report","owner":"vakenbolt","description":"Captures go test output and parses it into a single self-contained HTML file.","archived":false,"fork":false,"pushed_at":"2024-01-21T09:15:09.000Z","size":3808,"stargazers_count":162,"open_issues_count":32,"forks_count":34,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-07T22:42:13.666Z","etag":null,"topics":["command-line","command-line-tool","go","golang","reporting","reporting-tool","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vakenbolt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-29T22:47:12.000Z","updated_at":"2024-10-31T08:20:06.000Z","dependencies_parsed_at":"2024-06-18T17:02:42.254Z","dependency_job_id":"d04600a9-52e3-4779-b526-96711042d096","html_url":"https://github.com/vakenbolt/go-test-report","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vakenbolt%2Fgo-test-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vakenbolt%2Fgo-test-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vakenbolt%2Fgo-test-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vakenbolt%2Fgo-test-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vakenbolt","download_url":"https://codeload.github.com/vakenbolt/go-test-report/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248760568,"owners_count":21157381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","command-line-tool","go","golang","reporting","reporting-tool","testing-tools"],"created_at":"2024-08-01T20:00:58.812Z","updated_at":"2025-04-13T18:32:32.144Z","avatar_url":"https://github.com/vakenbolt.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cbr/\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/1223459/87218719-d185e300-c31a-11ea-897b-0db31b956ff1.png\"  width=\"700px\"\u003e\n\t\u003cbr/\u003e\n\t\u003cbr/\u003e\t\n\u003c/p\u003e\n\n\n\n[![license: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://shields.io/)\n[![version: 0.9.3](https://img.shields.io/badge/version-0.9.3-default.svg)](https://shields.io/)\n[![platforms: macos,linux,windows](https://img.shields.io/badge/platforms-macos%20|%20linux%20|%20windows-orange.svg)](https://shields.io/)\n[![goreportcard](https://goreportcard.com/badge/github.com/vakenbolt/go-test-report)](https://goreportcard.com/report/github.com/vakenbolt/go-test-report)\n\n`go-test-report` captures `go test` output and parses it into a _single_ self-contained HTML file. \n\n## Installation\n\nInstall the go binary using `go get`.\n\n\u003e **NOTE:** To run the binary, add the `bin` folder from go's workspace directory to the exported `PATH` variable in your shell. The default workspace folder is a directory named go within your user home directory (`~/go` for Linux and macOS, `%USERPROFILE%/go` for Windows).\n\n\n```shell\n$ go get -u github.com/vakenbolt/go-test-report/\n```\n\n## Usage\n\nTo use `go-test-report` with the default settings. \n\n```shell script\n$ go test -json | go-test-report\n```\n\nThe aforementioned command outputs an HTML file in the same location. \n\n```shell\ntest_report.html\n```\n\n\u003eEverything needed to display the HTML file correctly is located inside of the file, providing an easy way to store and host the test results.\n\n#### Understanding HTML test report\n\nThe HTML file generated by `go-test-report` is designed to provide an easy way to navigate test results. At the top of the page are general stats related to the test. Below is the title of the test followed by a section called _\"Test Groups\"_. Tests are organized into these groups which are represented by color-coded squares. A \u003cspan style=\"color: green\"\u003egreen\u003c/span\u003e square indicates that all test in that group passed. \n\n\u003cp align=\"center\"\u003e\n\t\u003cbr/\u003e\n\t\u003cimg src=\"https://user-images.githubusercontent.com/1223459/116140607-3093c900-a69d-11eb-9f03-f5d43f224dbf.png\" width=\"700px\" style=\"border: 1px #cccccc solid; padding: 8px\"\u003e\n\t\u003cbr/\u003e\n\t\u003cbr/\u003e\t\n\u003c/p\u003e\n\nA \u003cspan style=\"color: red\"\u003ered\u003c/span\u003e square indicates that at least one test in that group failed.  \n\n\u003cp align=\"center\"\u003e\n\t\u003cbr/\u003e\n\t\u003cimg src=\"https://user-images.githubusercontent.com/1223459/87218926-c9c73e00-c31c-11ea-9834-057d92de98bd.png\" width=\"216px\" style=\"border: 1px #cccccc solid; padding: 8px\"\u003e\n\t\u003cbr/\u003e\n\t\u003cbr/\u003e\t\n\u003c/p\u003e\n\nTo view the tests in a particular test group, click on any of the test group indicators. A selected group indicator will be colored in black. The number of tests allocated per test group can be set with the `groupSize` command-line flag.\n\n\u003cp align=\"center\"\u003e\n\t\u003cbr/\u003e\n\t\u003cimg src=\"https://user-images.githubusercontent.com/1223459/116140445-f5919580-a69c-11eb-922e-78e6b8487f67.png\" width=\"700px\" style=\"border: 1px #cccccc solid; padding: 8px\"\u003e\n\t\u003cbr/\u003e\n\t\u003cbr/\u003e\t\n\u003c/p\u003e\n\nTo view the output of a related test, click on the title of a test on the list. If you want to expand _all_ of the test on the list, simultaneously press `shift` and the test group indicator.\n\n\u003cp align=\"center\"\u003e\n\t\u003cbr/\u003e\n\t\u003cimg src=\"https://user-images.githubusercontent.com/1223459/87218282-d9438880-c316-11ea-9a81-54d4cd5b6d85.png\" width=\"700px\" style=\"border: 1px #cccccc solid; padding: 8px\"\u003e\n\u003c/p\u003e\n\n\n## Configuration\nAdditional configuration options are available via command-line flags.\n\n```\nUsage:\n  go-test-report [flags]\n  go-test-report [command]\n\nAvailable Commands:\n  help        Help about any command\n  version     Prints the version number of go-test-report\n\nFlags:\n  -g, --groupSize int   the number of tests per test group indicator (default 20)\n  -h, --help            help for go-test-report\n  -o, --output string   the HTML output file (default \"test_report.html\")\n  -s, --size string     the size (in pixels) of the clickable indicator for test result groups (default \"24\")\n  -t, --title string    the title text shown in the test report (default \"go-test-report\")\n  -v, --verbose         while processing, show the complete output from go test\n\nUse \"go-test-report [command] --help\" for more information about a command.\n```\n\nThe name of the default output file can be changed by using the `-o` or `--output` flag. For example, the following command will change the output to _my-test-report.html_.\n\n```bash\n$ go test -json | go-test-report -o my-test-report.html\n```\n\n\nTo change the default title shown in the `test_report.html` file.\n\n```bash\n$ go test -json | go-test-report -t \"My Test Report\"\n```\n\n\nThe default number of tests in a _test group_ can be changed using the `-g` or `--groupSize` flag. For example, the following command will change the default number of tests in a group to 8.\n\n```bash\n$ go test -json | go-test-report -g 8\n```\n\n\n\nUse the `-s` or `--size` flag to change the default size of the _group size indicator_. For example, the following command will set both the width and height of the size of the indicator to 48 pixels. \n\n```bash\n$ go test -json | go-test-report -s 48\n``` \n\nAdditionally, _both_ the width and height of the _group size indicator_ can be set. For example, the following command will set the size of the indicator to a width of 32 pixels and a height of 16 pixels.\n\n```bash\n$ go test -json | go-test-report -g 32x16\n```\n\n## Building from source\n\n[GNU make](https://www.gnu.org/software/make/) is used as the main build automation tool for go-test-report. MacOS users may need to upgrade their local `make` to the latest version using [homebrew](https://brew.sh/).\n\n```bash\n$ brew install homebrew/core/make\n```\n\n\u003e After the update is complete `make` will become `gmake`\n\nTo build `go-test-report` from source.\n\n```bash\n$ gmake genbuild\n```\n\nBecause `go-test-report` embeds the HTML and Javascript code necessary to generate the report output file, a command to generate the embedded go code is needed. \n\n```bash\n$ gmake gencode\n```\n\u003e Alternatively, `make genbuild` can be used which automatically runs `gencode` _before_ `genbuild`\n\n\nTo build the testing container _(This is the same docker image used during build automation)_:\n\n```bash\n$gmake dockertest\n```\n\nTo build release binaries,\n\n```bash\n$ gmake buildall\n```\n\u003e Creates a folder in the root project folder called `release_builds` that contains builds for the following platforms:\n\u003e \n\u003e - `darwin/amd64` (MacOS)\n\u003e - `linux/amd64`\n\u003e - `windows/amd64`\n\n## Contributors\n\n[@afbjorklund](https://github.com/afbjorklund)\n[@quarckster](https://github.com/quarckster)\n[@vakenbolt](https://github.com/vakenbolt)\n\n\n## Contribute \u0026 Support\n\n- Add a GitHub Star\n- Suggest [new features, ideas and optimizations](https://github.com/vakenbolt/go-test-report/issues)\n- [Report issues](https://github.com/vakenbolt/go-test-report/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvakenbolt%2Fgo-test-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvakenbolt%2Fgo-test-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvakenbolt%2Fgo-test-report/lists"}