Skip to content

Commit 3ed5c77

Browse files
committed
Fixed int-tests
1 parent b3dc7a8 commit 3ed5c77

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

tests/scale_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ func TestScaleClusterNonTLS(t *testing.T) {
5151

5252
// Add 2 DBServers, 1 coordinator
5353
updated, err := updateDeployment(c, depl.GetName(), ns, func(spec *api.DeploymentSpec) {
54-
spec.DBServers.Count = 5
55-
spec.Coordinators.Count = 4
54+
spec.DBServers.Count = util.NewInt(5)
55+
spec.Coordinators.Count = util.NewInt(4)
5656
})
5757
if err != nil {
5858
t.Fatalf("Failed to update deployment: %v", err)
@@ -67,8 +67,8 @@ func TestScaleClusterNonTLS(t *testing.T) {
6767

6868
// Remove 3 DBServers, 2 coordinator
6969
updated, err = updateDeployment(c, depl.GetName(), ns, func(spec *api.DeploymentSpec) {
70-
spec.DBServers.Count = 3
71-
spec.Coordinators.Count = 2
70+
spec.DBServers.Count = util.NewInt(3)
71+
spec.Coordinators.Count = util.NewInt(2)
7272
})
7373
if err != nil {
7474
t.Fatalf("Failed to update deployment: %v", err)
@@ -93,7 +93,7 @@ func TestScaleCluster(t *testing.T) {
9393

9494
// Prepare deployment config
9595
depl := newDeployment("test-scale" + uniuri.NewLen(4))
96-
depl.Spec.Mode = api.DeploymentModeCluster
96+
depl.Spec.Mode = api.NewMode(api.DeploymentModeCluster)
9797
depl.Spec.TLS = api.TLSSpec{} // should auto-generate cert
9898
depl.Spec.SetDefaults(depl.GetName()) // this must be last
9999

@@ -121,8 +121,8 @@ func TestScaleCluster(t *testing.T) {
121121

122122
// Add 2 DBServers, 1 coordinator
123123
updated, err := updateDeployment(c, depl.GetName(), ns, func(spec *api.DeploymentSpec) {
124-
spec.DBServers.Count = 5
125-
spec.Coordinators.Count = 4
124+
spec.DBServers.Count = util.NewInt(5)
125+
spec.Coordinators.Count = util.NewInt(4)
126126
})
127127
if err != nil {
128128
t.Fatalf("Failed to update deployment: %v", err)
@@ -137,8 +137,8 @@ func TestScaleCluster(t *testing.T) {
137137

138138
// Remove 3 DBServers, 2 coordinator
139139
updated, err = updateDeployment(c, depl.GetName(), ns, func(spec *api.DeploymentSpec) {
140-
spec.DBServers.Count = 3
141-
spec.Coordinators.Count = 2
140+
spec.DBServers.Count = util.NewInt(3)
141+
spec.Coordinators.Count = util.NewInt(2)
142142
})
143143
if err != nil {
144144
t.Fatalf("Failed to update deployment: %v", err)

tests/test_util.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,13 @@ func clusterHealthEqualsSpec(h driver.ClusterHealth, spec api.DeploymentSpec) er
239239
}
240240
}
241241
}
242-
if spec.Agents.Count == agents &&
243-
spec.DBServers.Count == goodDBServers &&
244-
spec.Coordinators.Count == goodCoordinators {
242+
if spec.Agents.GetCount() == agents &&
243+
spec.DBServers.GetCount() == goodDBServers &&
244+
spec.Coordinators.GetCount() == goodCoordinators {
245245
return nil
246246
}
247247
return fmt.Errorf("Expected %d,%d,%d got %d,%d,%d",
248-
spec.Agents.Count, spec.DBServers.Count, spec.Coordinators.Count,
248+
spec.Agents.GetCount(), spec.DBServers.GetCount(), spec.Coordinators.GetCount(),
249249
agents, goodDBServers, goodCoordinators,
250250
)
251251
}

0 commit comments

Comments
 (0)