-
Below is my junit report. It shows duration for test (It) along with BeforeAll & JustAfterEach.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
hey @ajaggapa the junit report format is quite limited and there is not a formal junit spec that desribes how to add additional metadata. I recommend generating Ginkgo's json output using [
{
"SpecEventType": "Node",
"CodeLocation": {
"FileName": "/Users/onsi/code/ginkgo/integration/integration_suite_test.go",
"LineNumber": 49
},
"TimelineLocation": {
"Order": 7,
"Time": "2025-03-05T09:26:49.814826-07:00"
},
"Message": "TOP-LEVEL",
"NodeType": "BeforeEach"
},
{
"SpecEventType": "Node (End)",
"CodeLocation": {
"FileName": "/Users/onsi/code/ginkgo/integration/integration_suite_test.go",
"LineNumber": 49
},
"TimelineLocation": {
"Order": 9,
"Time": "2025-03-05T09:26:49.814914-07:00"
},
"Message": "TOP-LEVEL",
"Duration": 87542,
"NodeType": "BeforeEach"
},
{
"SpecEventType": "Node",
"CodeLocation": {
"FileName": "/Users/onsi/code/ginkgo/integration/precompiled_test.go",
"LineNumber": 55
},
"TimelineLocation": {
"Order": 10,
"Time": "2025-03-05T09:26:49.815011-07:00"
},
"Message": "ginkgo build with custom output",
"NodeType": "BeforeEach"
},
{
"SpecEventType": "Node (End)",
"CodeLocation": {
"FileName": "/Users/onsi/code/ginkgo/integration/precompiled_test.go",
"LineNumber": 55
},
"TimelineLocation": {
"Order": 12,
"Time": "2025-03-05T09:26:49.815498-07:00"
},
"Message": "ginkgo build with custom output",
"Duration": 486416,
"NodeType": "BeforeEach"
},
{
"SpecEventType": "Node",
"CodeLocation": {
"FileName": "/Users/onsi/code/ginkgo/integration/precompiled_test.go",
"LineNumber": 65
},
"TimelineLocation": {
"Order": 13,
"Time": "2025-03-05T09:26:49.815613-07:00"
},
"Message": "should build with custom path",
"NodeType": "It"
},
{
"SpecEventType": "Node (End)",
"CodeLocation": {
"FileName": "/Users/onsi/code/ginkgo/integration/precompiled_test.go",
"LineNumber": 65
},
"TimelineLocation": {
"Offset": 31,
"Order": 15,
"Time": "2025-03-05T09:26:51.148815-07:00"
},
"Message": "should build with custom path",
"Duration": 1333200083,
"NodeType": "It"
},
{
"SpecEventType": "Node",
"CodeLocation": {
"FileName": "/Users/onsi/code/ginkgo/integration/integration_suite_test.go",
"LineNumber": 53
},
"TimelineLocation": {
"Offset": 31,
"Order": 16,
"Time": "2025-03-05T09:26:51.151544-07:00"
},
"Message": "TOP-LEVEL",
"NodeType": "AfterEach"
},
{
"SpecEventType": "Node (End)",
"CodeLocation": {
"FileName": "/Users/onsi/code/ginkgo/integration/integration_suite_test.go",
"LineNumber": 53
},
"TimelineLocation": {
"Offset": 31,
"Order": 18,
"Time": "2025-03-05T09:26:51.15284-07:00"
},
"Message": "TOP-LEVEL",
"Duration": 1296125,
"NodeType": "AfterEach"
},
{
"SpecEventType": "Node",
"CodeLocation": {
"FileName": "/Users/onsi/code/ginkgo/integration/precompiled_test.go",
"LineNumber": 60
},
"TimelineLocation": {
"Offset": 31,
"Order": 19,
"Time": "2025-03-05T09:26:51.155998-07:00"
},
"Message": "ginkgo build with custom output",
"NodeType": "DeferCleanup (Each)"
},
{
"SpecEventType": "Node (End)",
"CodeLocation": {
"FileName": "/Users/onsi/code/ginkgo/integration/precompiled_test.go",
"LineNumber": 60
},
"TimelineLocation": {
"Offset": 31,
"Order": 21,
"Time": "2025-03-05T09:26:51.156054-07:00"
},
"Message": "ginkgo build with custom output",
"Duration": 55625,
"NodeType": "DeferCleanup (Each)"
}
] As you can see it includes timestamps for each event and durations (in µs) for the |
Beta Was this translation helpful? Give feedback.
hey @ajaggapa the junit report format is quite limited and there is not a formal junit spec that desribes how to add additional metadata.
I recommend generating Ginkgo's json output using
--json-report
and using that instead of or alongisde the junit output. Each spec in the JSON file includes aSpecEvents
entry that looks like this (this is from one of Ginkgo's integration tests):