Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support t.Helper() #84

Closed
siller174 opened this issue Mar 16, 2024 · 1 comment
Closed

Support t.Helper() #84

siller174 opened this issue Mar 16, 2024 · 1 comment

Comments

@siller174
Copy link
Collaborator

siller174 commented Mar 16, 2024

  1. Support Helper() in StepCtx

  2. Add t.Helper() to Error() and ErrorF

Test: bla_test.go

func TestName(t *testing.T) {
	runner.Run(t, "Single test with allure-go Runner", func(t provider.T) {
		t.Epic("Compare with allure-go")
		t.Description("New Test Description")
		t.WithNewStep("Step description", func(ctx provider.StepCtx) {
			ctx.Errorf("Error message")
		})
	})
}

func TestName1(t *testing.T) {
	runner.Run(t, "Single test with allure-go Runner", func(t provider.T) {
		t.Errorf("Error message")
	})
}

Logs without helper:

=== RUN   TestName
=== RUN   TestName/Single_test_with_allure-go_Runner
    common.go:125: Error message
--- FAIL: TestName (0.00s)
    --- FAIL: TestName/Single_test_with_allure-go_Runner (0.00s)


=== RUN   TestName1
=== RUN   TestName1/Single_test_with_allure-go_Runner
    common.go:125: Error message
--- FAIL: TestName1 (0.00s)
    --- FAIL: TestName1/Single_test_with_allure-go_Runner (0.00s)

Log with helper:

=== RUN   TestName
=== RUN   TestName/Single_test_with_allure-go_Runner
     bla_test.go:22: Error message  <--- trace from test
--- FAIL: TestName (0.00s)
    --- FAIL: TestName/Single_test_with_allure-go_Runner (0.00s)


=== RUN   TestName1
=== RUN   TestName1/Single_test_with_allure-go_Runner
    bla_test.go:22: Error message <--- trace from test
--- FAIL: TestName1 (0.00s)
    --- FAIL: TestName1/Single_test_with_allure-go_Runner (0.00s)


FAIL
@siller174
Copy link
Collaborator Author

#85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant