-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduction of 'MustPassRepeatedly' decorator (#1051)
* introduction of RepeatAttempts decorator * first review * Refactor: renamed 'test' to 'spec' in various parts of the doc and code * remove repeated FAILEd log; correct entry point to FLAKEY TEST log * removing Focus from test * remove multipleExecutionDecorator type switch * remove multipleExecutionDecorator type switch - pt 2
- Loading branch information
1 parent
4442772
commit 047c02f
Showing
22 changed files
with
505 additions
and
87 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
33 changes: 33 additions & 0 deletions
33
...gration/_fixtures/decorations_fixture/flaky_repeated/flaky_repeated_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,33 @@ | ||
package decorations_fixture_test | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestDecorationsFixture(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "DecorationsFixture Suite") | ||
} | ||
|
||
var countFlake = 0 | ||
var countRepeat = 0 | ||
|
||
var _ = Describe("some decorated specs", func() { | ||
It("passes eventually", func() { | ||
countFlake += 1 | ||
if countFlake < 3 { | ||
Fail("fail") | ||
} | ||
}, FlakeAttempts(3)) | ||
|
||
It("fails eventually", func() { | ||
countRepeat += 1 | ||
if countRepeat >= 3 { | ||
Fail(fmt.Sprintf("failed on attempt #%d", countRepeat)) | ||
} | ||
}, MustPassRepeatedly(3)) | ||
}) |
19 changes: 0 additions & 19 deletions
19
...ation/_fixtures/decorations_fixture/invalid_decorations/invalid_decorations_suite_test.go
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...pts_mustpassrepeatedly/invalid_decorations_flakeattempts_mustpassrepeatedly_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,19 @@ | ||
package invalid_decorations_flakeattempts_mustpassrepeatedly_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestInvalidDecorations(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "InvalidDecorations Suite - MustPassRepeatedly and FlakeAttempts") | ||
} | ||
|
||
var _ = Describe("invalid decorators: mustpassrepeatedly and flakeattempts", FlakeAttempts(3), MustPassRepeatedly(3), func() { | ||
It("never runs", func() { | ||
|
||
}) | ||
}) |
19 changes: 19 additions & 0 deletions
19
...ure/invalid_decorations_focused_pending/invalid_decorations_focused_pending_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,19 @@ | ||
package invalid_decorations_focused_pending_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestInvalidDecorations(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "InvalidDecorations Suite - Focused and Pending") | ||
} | ||
|
||
var _ = Describe("invalid decorators: focused and pending", Focus, Pending, func() { | ||
It("never runs", func() { | ||
|
||
}) | ||
}) |
File renamed without changes.
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.