All e2e tests should use NewFramework

Allows someone to replace createTestingNS consistently
This commit is contained in:
Clayton Coleman
2015-10-21 22:28:39 -04:00
parent 507bc3de4f
commit a50fbd6636
11 changed files with 101 additions and 131 deletions

View File

@@ -175,24 +175,13 @@ func waitForStableCluster(c *client.Client) int {
}
var _ = Describe("SchedulerPredicates", func() {
framework := Framework{BaseName: "sched-pred"}
var c *client.Client
var nodeList *api.NodeList
var totalPodCapacity int64
var RCName string
var ns string
BeforeEach(func() {
framework.beforeEach()
c = framework.Client
ns = framework.Namespace.Name
var err error
nodeList, err = c.Nodes().List(labels.Everything(), fields.Everything())
expectNoError(err)
})
AfterEach(func() {
defer framework.afterEach()
rc, err := c.ReplicationControllers(ns).Get(RCName)
if err == nil && rc.Spec.Replicas != 0 {
By("Cleaning up the replication controller")
@@ -201,6 +190,16 @@ var _ = Describe("SchedulerPredicates", func() {
}
})
framework := NewFramework("sched-pred")
BeforeEach(func() {
c = framework.Client
ns = framework.Namespace.Name
var err error
nodeList, err = c.Nodes().List(labels.Everything(), fields.Everything())
expectNoError(err)
})
// This test verifies that max-pods flag works as advertised. It assumes that cluster add-on pods stay stable
// and cannot be run in parallel with any other test that touches Nodes or Pods. It is so because to check
// if max-pods is working we need to fully saturate the cluster and keep it in this state for few seconds.