ozontech / allure-go

Complete Allure provider in Go which doesn't overload the interface usage
https://t.me/allure_go_chat
Apache License 2.0
306 stars 33 forks source link

Error is not included in the allure report if it is in the BeforeAll hook. #6

Closed AleksandrGurkin closed 2 years ago

AleksandrGurkin commented 2 years ago

Describe the bug If during the initialization of the suite you add a step with a check that will fall, the entire suite in the allure report is simply ignored. The information in the console is displayed correctly

To Reproduce

import (
    "testing"

    "github.com/ozontech/allure-go/pkg/framework/provider"
    "github.com/ozontech/allure-go/pkg/framework/suite"
)

type BeforeAfterDemoSuite struct {
    suite.Suite
}

func (s *BeforeAfterDemoSuite) BeforeAll(t provider.T) {
    t.WithNewStep("Before suite Step", func(sCtx provider.StepCtx) {
        sCtx.Require().Equal(1, 2, "lol")
    })
}

func (s *BeforeAfterDemoSuite) TestBeforeAfterTest(t provider.T) {
    t.Epic("Demo")
    t.Feature("BeforeAfter")
    t.Title("Test wrapped with SetUp & TearDown")
    t.Description(`
        This test wrapped with SetUp and TearDown containert.`)

    t.Tags("BeforeAfter")
}

func TestBeforesAfters(t *testing.T) {
    t.Parallel()
    suite.RunSuite(t, new(BeforeAfterDemoSuite))
}

Expected behavior Display the suite in the report, with an error in the setup and a skipped body of tests.

koodeex commented 2 years ago

Hello!

We already working on that issue. It will be fixed in the closest release.

koodeex commented 2 years ago

@AleksandrGurkin , FYI

issue can be tested at v0.6.6 tag (beta)

It will be a great pleasure to get your feed back

Also, I will be really happy if you could review PR

koodeex commented 2 years ago

@AleksandrGurkin , FYI

New beta tag v0.6.7 released

koodeex commented 2 years ago

@AleksandrGurkin , FYI

New beta tag v0.6.9 released

koodeex commented 2 years ago

@AleksandrGurkin , FYI release v0.6.11 add this feature. You are welcome to try :)