-
-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Progress Reports point the user at the current running line of code, including a preview of the actual source code. They include a best guess at any relevant goroutines. A Progress Report can be generated at any time by sending Ginkgo a SIGINFO (^T on MacOS) or SIGUSR1. In addition, the user can specify --poll-progress-after and --poll-progress-interval to have Ginkgo start periodically emitting progress reports if a given node takes too long. These can be overriden/set on a per-node basis with the PollProgressAfter and PollProgressInterval decorators. Ginkgo also uses this progress reporting infrastructure under the hood when handling timeouts and interrupts. This yields much more focused, useful, and informative stack traces than previously.
- Loading branch information
Showing
34 changed files
with
1,461 additions
and
210 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
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: 13 additions & 0 deletions
13
integration/_fixtures/progress_reporter_fixture/progress_reporter_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,13 @@ | ||
package progress_reporter_fixture_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestProgressReporterFixture(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "ProgressReporterFixture Suite") | ||
} |
26 changes: 26 additions & 0 deletions
26
integration/_fixtures/progress_reporter_fixture/progress_reporter_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,26 @@ | ||
package progress_reporter_fixture_test | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"time" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
) | ||
|
||
var _ = Describe("ProgressReporter", func() { | ||
It("can track on demand", func() { | ||
By("Step A") | ||
By("Step B") | ||
fmt.Printf("READY %d\n", os.Getpid()) | ||
time.Sleep(time.Second) | ||
}) | ||
|
||
It("--poll-progress-after tracks things that take too long", Label("parallel"), func() { | ||
time.Sleep(2 * time.Second) | ||
}) | ||
|
||
It("decorator tracks things that take too long", Label("parallel"), func() { | ||
time.Sleep(1 * time.Second) | ||
}, PollProgressAfter(500*time.Millisecond)) | ||
}) |
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.