Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information