Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicity enable route_sharing feature on tests that need it #2331

Merged
merged 5 commits into from
Oct 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 62 additions & 61 deletions integration/helpers/commonisolated/common_isolated_setup.go
Original file line number Diff line number Diff line change
@@ -1,86 +1,87 @@
package commonisolated

import (
"fmt"
"testing"
"time"
"fmt"
"testing"
"time"

"code.cloudfoundry.org/cli/integration/helpers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"code.cloudfoundry.org/cli/integration/helpers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

const (
CFEventuallyTimeout = 300 * time.Second
CFConsistentlyTimeout = 500 * time.Millisecond
RealIsolationSegment = "persistent_isolation_segment"
DockerImage = "cloudfoundry/diego-docker-app-custom"
CFEventuallyTimeout = 300 * time.Second
CFConsistentlyTimeout = 500 * time.Millisecond
RealIsolationSegment = "persistent_isolation_segment"
DockerImage = "cloudfoundry/diego-docker-app-custom"
)

func CommonTestIsolated(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Isolated Integration Suite")
RegisterFailHandler(Fail)
RunSpecs(t, "Isolated Integration Suite")
}

func CommonGinkgoSetup(
// Per suite Level
failureSummaryFilename string,
apiURL *string,
skipSSLValidation *bool,
readOnlyOrg *string,
readOnlySpace *string,
// Per suite Level
failureSummaryFilename string,
apiURL *string,
skipSSLValidation *bool,
readOnlyOrg *string,
readOnlySpace *string,

// Per test level
homeDir *string,
// Per test level
homeDir *string,
) interface{} {
var _ = SynchronizedBeforeSuite(func() []byte {
_, _ = GinkgoWriter.Write([]byte("==============================Global FIRST Node Synchronized Before Each=============================="))
SetDefaultEventuallyTimeout(CFEventuallyTimeout)
SetDefaultConsistentlyDuration(CFConsistentlyTimeout)
var _ = SynchronizedBeforeSuite(func() []byte {
_, _ = GinkgoWriter.Write([]byte("==============================Global FIRST Node Synchronized Before Each=============================="))
SetDefaultEventuallyTimeout(CFEventuallyTimeout)
SetDefaultConsistentlyDuration(CFConsistentlyTimeout)

helpers.SetupSynchronizedSuite(func() {
helpers.EnableFeatureFlag("diego_docker")
helpers.EnableFeatureFlag("service_instance_sharing")
})
helpers.SetupSynchronizedSuite(func() {
helpers.EnableFeatureFlag("diego_docker")
helpers.EnableFeatureFlag("service_instance_sharing")
helpers.EnableFeatureFlag("route_sharing")
})

_, _ = GinkgoWriter.Write([]byte("==============================End of Global FIRST Node Synchronized Before Each=============================="))
_, _ = GinkgoWriter.Write([]byte("==============================End of Global FIRST Node Synchronized Before Each=============================="))

return nil
}, func(_ []byte) {
_, _ = GinkgoWriter.Write([]byte(fmt.Sprintf("==============================Global Node %d Synchronized Before Each==============================", GinkgoParallelNode())))
// Ginkgo Globals
SetDefaultEventuallyTimeout(CFEventuallyTimeout)
SetDefaultConsistentlyDuration(CFConsistentlyTimeout)
return nil
}, func(_ []byte) {
_, _ = GinkgoWriter.Write([]byte(fmt.Sprintf("==============================Global Node %d Synchronized Before Each==============================", GinkgoParallelNode())))
// Ginkgo Globals
SetDefaultEventuallyTimeout(CFEventuallyTimeout)
SetDefaultConsistentlyDuration(CFConsistentlyTimeout)

// Setup common environment variables
helpers.TurnOffColors()
// Setup common environment variables
helpers.TurnOffColors()

*readOnlyOrg, *readOnlySpace = helpers.SetupReadOnlyOrgAndSpace()
_, _ = GinkgoWriter.Write([]byte(fmt.Sprintf("==============================End of Global Node %d Synchronized Before Each==============================", GinkgoParallelNode())))
})
*readOnlyOrg, *readOnlySpace = helpers.SetupReadOnlyOrgAndSpace()
_, _ = GinkgoWriter.Write([]byte(fmt.Sprintf("==============================End of Global Node %d Synchronized Before Each==============================", GinkgoParallelNode())))
})

var _ = SynchronizedAfterSuite(func() {
_, _ = GinkgoWriter.Write([]byte(fmt.Sprintf("==============================Global Node %d Synchronized After Each==============================", GinkgoParallelNode())))
*homeDir = helpers.SetHomeDir()
helpers.SetAPI()
helpers.LoginCF()
helpers.QuickDeleteOrg(*readOnlyOrg)
helpers.DestroyHomeDir(*homeDir)
_, _ = GinkgoWriter.Write([]byte(fmt.Sprintf("==============================End of Global Node %d Synchronized After Each==============================", GinkgoParallelNode())))
}, func() {})
var _ = SynchronizedAfterSuite(func() {
_, _ = GinkgoWriter.Write([]byte(fmt.Sprintf("==============================Global Node %d Synchronized After Each==============================", GinkgoParallelNode())))
*homeDir = helpers.SetHomeDir()
helpers.SetAPI()
helpers.LoginCF()
helpers.QuickDeleteOrg(*readOnlyOrg)
helpers.DestroyHomeDir(*homeDir)
_, _ = GinkgoWriter.Write([]byte(fmt.Sprintf("==============================End of Global Node %d Synchronized After Each==============================", GinkgoParallelNode())))
}, func() {})

var _ = BeforeEach(func() {
_, _ = GinkgoWriter.Write([]byte("==============================Global Before Each=============================="))
*homeDir = helpers.SetHomeDir()
*apiURL, *skipSSLValidation = helpers.SetAPI()
_, _ = GinkgoWriter.Write([]byte("==============================End of Global Before Each=============================="))
})
var _ = BeforeEach(func() {
_, _ = GinkgoWriter.Write([]byte("==============================Global Before Each=============================="))
*homeDir = helpers.SetHomeDir()
*apiURL, *skipSSLValidation = helpers.SetAPI()
_, _ = GinkgoWriter.Write([]byte("==============================End of Global Before Each=============================="))
})

var _ = AfterEach(func() {
_, _ = GinkgoWriter.Write([]byte("==============================Global After Each==============================\n"))
helpers.DestroyHomeDir(*homeDir)
_, _ = GinkgoWriter.Write([]byte("==============================End of Global After Each=============================="))
})
var _ = AfterEach(func() {
_, _ = GinkgoWriter.Write([]byte("==============================Global After Each==============================\n"))
helpers.DestroyHomeDir(*homeDir)
_, _ = GinkgoWriter.Write([]byte("==============================End of Global After Each=============================="))
})

return nil
return nil
}