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

Add junit config option for omitting leafnodetype #1088

Merged
merged 1 commit into from Dec 8, 2022

Conversation

jbpratt
Copy link
Contributor

@jbpratt jbpratt commented Dec 6, 2022

similarly to de44005, users may also want to omit the LeafNodeType

allow omitting the LeafNodeType ([It]) from being included in the
junit results file by adding a new config option and skipping over the
setting of name to LeafNodeType. Default behavior remains as is.

Signed-off-by: Brady Pratt bpratt@redhat.com

package ginkgo

import (
    "testing"

    "github.com/onsi/ginkgo/v2/reporters"
    . "github.com/onsi/gomega"
)

func TestPR(t *testing.T) {
    ReportAfterSuite("Test PR", func(report Report) {
        reporters.GenerateJUnitReportWithConfig(
            report,
            "test.xml",
            reporters.JunitReportConfig{OmitLeafNodeType: true},
        )
    })

    RegisterFailHandler(Fail)
    RunSpecs(t, "Test PR", Label("pr-test"))
}

var _ = Describe("String comparison", func() {
    It("should be equal", Label("pr-test"), func() {
        Expect("apple").To(Equal("apple"))
    })
})
❯ cat test.xml | grep testcase
          <testcase name="String comparison should be equal [pr-test]" classname="Test PR" status="skipped" time="0">
          </testcase>

@jbpratt jbpratt force-pushed the junit-config-omit-leafnodetype branch 2 times, most recently from 2ba055e to 88b878f Compare December 7, 2022 20:33
allow omitting the LeafNodeType (`[It]`) from being included in the
junit results file by adding a new config option and skipping over the
setting of name to LeafNodeType. Default behavior remains as is.

a follow up on de44005

Signed-off-by: Brady Pratt <bpratt@redhat.com>
@onsi onsi merged commit 956e6d2 into onsi:master Dec 8, 2022
@onsi
Copy link
Owner

onsi commented Dec 8, 2022

looks good now - thanks!

@jbpratt jbpratt deleted the junit-config-omit-leafnodetype branch December 8, 2022 08:19
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

Successfully merging this pull request may close these issues.

None yet

2 participants