Skip to content

Commit

Permalink
Fix outline history (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop authored Oct 29, 2024
1 parent 4d19402 commit dd0ad9a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/bench-*.txt
/vendor

allure-results
/allure-results
/allure-report
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ endif

## Run tests
test: test-unit

history:
mkdir -p allure-report/history
rm -rf ./allure-results/*
mkdir -p ./allure-results
cp -r ./allure-report/history ./allure-results/history
go test .
allure generate --clean

2 changes: 1 addition & 1 deletion _testdata/Failed.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: that fails
Feature: failing scenarios

Scenario: pass then fail 1
When I pass
Expand Down
2 changes: 1 addition & 1 deletion _testdata/Outline.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: that passes
Feature: outline with examples

Scenario Outline: 1 scenario 10 results
When I pass
Expand Down
2 changes: 1 addition & 1 deletion _testdata/Passed.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: that passes
Feature: passing scenarios

Scenario: pass and pass 1
When I pass
Expand Down
5 changes: 2 additions & 3 deletions formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ type scenarioContext struct {
// Pickle receives scenario.
func (f *formatter) Pickle(scenario *godog.Scenario) {
feature := f.Storage.MustGetFeature(scenario.Uri)
uid := uuid.New().String()
res := report.Result{
Name: scenario.Name,
HistoryID: feature.Feature.Name + ": " + scenario.Name + " (" + uid + ")",
HistoryID: feature.Feature.Name + ": " + scenario.Name + scenario.Id,
FullName: scenario.Uri + ":" + scenario.Name,
Description: scenario.Uri,
Labels: []report.Label{
Expand All @@ -95,7 +94,7 @@ func (f *formatter) Pickle(scenario *godog.Scenario) {
{Name: "language", Value: "Go"},
},
Start: report.GetTimestampMs(),
UUID: uid,
UUID: uuid.New().String(),
}

f.mu.Lock()
Expand Down

0 comments on commit dd0ad9a

Please sign in to comment.