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

Customize line ending in report #122

Open
fpawel opened this issue Aug 24, 2021 · 1 comment
Open

Customize line ending in report #122

fpawel opened this issue Aug 24, 2021 · 1 comment
Labels

Comments

@fpawel
Copy link

fpawel commented Aug 24, 2021

HI!
in formatter/formatter.go 107 we have hardcoded lines separtor Contents: strings.Join(test.Output, "\n"),
In fact, this breaks the display of the stack trace of the failed tests in Jenkins.
F.e. this

<testcase classname="zfs" name="TestZpoolTestSuite" time="0.000">
			<failure message="Failed" type=""></failure>
		</testcase>
		<testcase classname="zfs" name="TestZpoolTestSuite/TestGetFreeing_err" time="0.000">
			<failure message="Failed" type="">    suite.go:63: test panicked: failed&#xA;        goroutine 76 [running]:&#xA;        runtime/debug.Stack(0xc00006ab48, 0xd30260, 0x10707b0)&#xA;        github.com/stretchr/testify/suite.failOnPanic(0xc00012e900)&#xA;        panic(0xd30260, 0x10707b0)&#xA;        szs-op/zfs.(*ZpoolTestSuite).SetupTest(0xc000767e00)&#xA;        github.com/stretchr/testify/suite.Run.func1(0xc00012e900)&#xA;        testing.tRunner(0xc00012e900, 0xc0005a9290)&#xA;        created by testing.(*T).Run</failure>
		</testcase>
		<testcase classname="zfs" name="TestZpoolTestSuite/TestGetFreeing_noOutput" time="0.000">
			<failure message="Failed" type="">    suite.go:63: test panicked: failed&#xA;        goroutine 77 [running]:&#xA;        runtime/debug.Stack(0xc00006ab48, 0xd30260, 0x10707b0)&#xA;        github.com/stretchr/testify/suite.failOnPanic(0xc00012ea80)&#xA;        panic(0xd30260, 0x10707b0)&#xA;        szs-op/zfs.(*ZpoolTestSuite).SetupTest(0xc000767e00)&#xA;        github.com/stretchr/testify/suite.Run.func1(0xc00012ea80)&#xA;        testing.tRunner(0xc00012ea80, 0xc0005a9320)&#xA;        created by testing.(*T).Run</failure>
		</testcase>
		<testcase classname="zfs" name="TestZpoolTestSuite/TestGetFreeing_value" time="0.000">
			<failure message="Failed" type="">    suite.go:63: test panicked: failed&#xA;        goroutine 78 [running]:&#xA;        runtime/debug.Stack(0xc00006ab48, 0xd30260, 0x10707b0)&#xA;        github.com/stretchr/testify/suite.failOnPanic(0xc00012ec00)&#xA;        panic(0xd30260, 0x10707b0)&#xA;        szs-op/zfs.(*ZpoolTestSuite).SetupTest(0xc000767e00)&#xA;        github.com/stretchr/testify/suite.Run.func1(0xc00012ec00)&#xA;        testing.tRunner(0xc00012ec00, 0xc0005a93b0)&#xA;        created by testing.(*T).Run</failure>
		</testcase>
		<testcase classname="zfs" name="TestZpoolTestSuite/TestGetFreeing_zero" time="0.000">
			<failure message="Failed" type="">    suite.go:63: test panicked: failed&#xA;        goroutine 79 [running]:&#xA;        runtime/debug.Stack(0xc00006ab48, 0xd30260, 0x10707b0)&#xA;        github.com/stretchr/testify/suite.failOnPanic(0xc00012ed80)&#xA;        panic(0xd30260, 0x10707b0)&#xA;        szs-op/zfs.(*ZpoolTestSuite).SetupTest(0xc000767e00)&#xA;        github.com/stretchr/testify/suite.Run.func1(0xc00012ed80)&#xA;        testing.tRunner(0xc00012ed80, 0xc0005a9440)&#xA;        created by testing.(*T).Run</failure>
		</testcase>

is shown like this
image
I replaced word "&#xA;" with word "&#xD;&#xA;" in the report, as a result I got the expected picture
image
I see the solution to the problem in customizing the word added to the end of the line through the command line parameters. If you approve, I will offer an appropriate pull request

@jstemmer
Copy link
Owner

Are you running Jenkins on a Windows server, or is this something specific to Jenkins itself?

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

No branches or pull requests

2 participants