-
-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ginkgo output now includes a timeline-view of the spec
This commit changers Ginkgo default output. Spec details are now presented as a **timeline** that includes events that occur during the spec lifecycle interleaved with any GinkgoWriter content. This makes is much easier to understand the flow of a spec and where a given failure occurs. The --progress, --slow-spec-threshold, --always-emit-ginkgo-writer flags and the SuppressProgressReporting decorator have all been deprecated. Instead the existing -v and -vv flags better capture the level of verbosity to display. However, a new --show-node-events flag is added to include node > Enter and < Exit events in the spec timeline. JUnit reports now include the timeline (rendered with -vv) and custom JUnit reports can be configured and generated using GenerateJUnitReportWithConfig(report types.Report, dst string, config JunitReportConfig)`
- Loading branch information
Showing
60 changed files
with
4,916 additions
and
2,341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
integration/_fixtures/progress_fixture/progress_fixture_suite_test.go
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
integration/_fixtures/progress_fixture/progress_fixture_test.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
integration/_fixtures/timeline_fixture/timeline_fixture_suite_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package timeline_fixture_test | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
"github.com/onsi/ginkgo/v2/types" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestTimelineFixture(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "TimelineFixture Suite") | ||
} | ||
|
||
var _ = Describe("a full timeline", Serial, func() { | ||
Describe("a flaky test", func() { | ||
BeforeEach(func() { | ||
By("logging some events") | ||
GinkgoWriter.Println("hello!") | ||
AddReportEntry("a report!", "Of {{bold}}great{{/}} value") | ||
DeferCleanup(func() { | ||
By("cleaning up a bit", func() { | ||
time.Sleep(time.Millisecond * 50) | ||
GinkgoWriter.Println("all done!") | ||
}) | ||
}) | ||
}) | ||
|
||
i := 0 | ||
|
||
It("retries a few times", func() { | ||
i += 1 | ||
GinkgoWriter.Println("let's try...") | ||
if i < 3 { | ||
Fail("bam!") | ||
} | ||
GinkgoWriter.Println("hooray!") | ||
}, FlakeAttempts(3)) | ||
|
||
AfterEach(func() { | ||
if i == 3 { | ||
GinkgoWriter.Println("feeling sleepy...") | ||
time.Sleep(time.Millisecond * 200) | ||
} | ||
}, PollProgressAfter(time.Millisecond*100)) | ||
}) | ||
|
||
Describe("a test with multiple failures", func() { | ||
It("times out", func(ctx SpecContext) { | ||
By("waiting...") | ||
<-ctx.Done() | ||
GinkgoWriter.Println("then failing!") | ||
Fail("welp") | ||
}, NodeTimeout(time.Millisecond*100)) | ||
|
||
AfterEach(func() { | ||
panic("aaah!") | ||
}) | ||
}) | ||
|
||
It("passes happily", func() { | ||
AddReportEntry("a verbose-only report", types.ReportEntryVisibilityFailureOrVerbose) | ||
AddReportEntry("a hidden report", types.ReportEntryVisibilityNever) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.