generated from bool64/go-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
541 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package allure_test | ||
|
||
import ( | ||
"bytes" | ||
"errors" | ||
"testing" | ||
|
||
"github.com/bool64/godogx/allure" | ||
"github.com/cucumber/godog" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestRegister(t *testing.T) { | ||
allure.RegisterFormatter() | ||
|
||
out := bytes.NewBuffer(nil) | ||
|
||
suite := godog.TestSuite{ | ||
ScenarioInitializer: func(s *godog.ScenarioContext) { | ||
s.Step("I pass", func() {}) | ||
s.Step("I fail", func() error { return errors.New("failed") }) | ||
}, | ||
Options: &godog.Options{ | ||
Format: "allure", | ||
Output: out, | ||
NoColors: true, | ||
Paths: []string{"../_testdata"}, | ||
}, | ||
} | ||
|
||
st := suite.Run() | ||
assert.Equal(t, 1, st) // Failed. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Package allure provides allure formatter for godog. | ||
package allure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package allure | ||
|
||
// Executor describes execution context. | ||
type Executor struct { | ||
Name string `json:"name,omitempty" example:"Jenkins"` | ||
// Type may be one of [github, gitlab, teamcity, bamboo, jenkins] or a custom one. | ||
Type string `json:"type,omitempty" example:"jenkins"` | ||
URL string `json:"url,omitempty" example:"url"` | ||
BuildOrder int `json:"buildOrder,omitempty" example:"13"` | ||
BuildName string `json:"buildName,omitempty" example:"allure-report_deploy#13"` | ||
BuildURL string `json:"buildUrl,omitempty" example:"http://example.org/build#13"` | ||
ReportURL string `json:"reportUrl,omitempty" example:"http://example.org/build#13/AllureReport"` | ||
ReportName string `json:"reportName,omitempty" example:"Demo allure report"` | ||
} | ||
|
||
//{ | ||
// "name": "Jenkins", | ||
// "type": "jenkins", | ||
// "url": "http://example.org", | ||
// "buildOrder": 13, | ||
// "buildName": "allure-report_deploy#13", | ||
// "buildUrl": "http://example.org/build#13", | ||
// "reportUrl": "http://example.org/build#13/AllureReport", | ||
// "reportName": "Demo allure report" | ||
//} |
Oops, something went wrong.