Allure Generator Go
Overview
This project is a functionality-limited port of the allure-generator module from the Allure 2 project to the Go programming language.
The module is implemented as a Go package and can be integrated into any suitable application — whether it’s an HTTP server or a CLI tool.
Limitations
- Following plugins are not implemented
Allure1Plugin
GaPlugin
IdeaLinksPlugin
InfluxDbExportPlugin
LaunchPlugin
MailPlugin
OwnerPlugin
PrometheusExportPlugin
RetryPlugin and RetryTrendPlugin
ExecutorPlugin is initiated but executor logic is not implemented
- UI generation is not implemented. Pre-built html, js, css files are used from
allure cli 2.33.0
Usage
- Install the package:
go get github.com/reasunta/allure-generator-go
- Call
generator.Generate() function
package main
import (
"github.com/reasunta/allure-generator-go/generator"
"filepath"
)
func main() {
workingDir := "target"
input := filepath.Join(workingDir, "allure-results")
output := filepath.Join(workingDir, "go-allure-report")
threadsCount := 1 // handle data files using <threadsCount> working goroutines
useHardLinks := true // create hard links instead of true file copying for attachments files
writeData := true // populate `data` directory with files (useful for debug)
useBars := false // use `github.com/vbauerster/mpb/v8` to draw progress bars in CLI (useful for the process visualization)
err := generator.Generate(input, output, threadsCount, useHardLinks, writeData, useBars)
if err != nil {
fmt.Println(err)
}
}
Versions
The project version corresponds following allure2 version