You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sanity: support embedding tests multiple time in Ginkgo, II
This reverts commit ddf8b3f. It was
meant to enable the call sequence DescribeSanity,
RegisterTestsInGinkgo, DescribeSanity, RegisterTestsInGinkgo, but that
call sequence is invalid: DescribeSanity must be called during the
init phase, then RegisterTestsInGinkgo may be called multiple times
with different configs.
That usage got broken by the commit above because the second
RegisterTestsInGinkgo then didn't add any of the tests defined by the
sanity package.
Users who want to add their own sanity tests can do it like this:
Describe( ... func() {
config := &sanity.TestConfig{...}
Describe(..., func() {
sc := NewTestContext(config)
BeforeEach(func() {
sc.Setup()
})
AfterEach(func() {
sc.Teardown()
})
Describe(..., func() {
...
})
})
sanity.GinkgoTest(config)
})
NewTestContext must be made public for this to work. Otherwise
TestContext has be initialized manually, which isn't as nice.
0 commit comments