Skip to content

Commit df2f571

Browse files
committed
Add missing tests
1 parent 7b745c6 commit df2f571

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

mws/mws.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ type GCPCommonNetworkConfig struct {
9696

9797
type GCPNetwork struct {
9898
GCPManagedNetworkConfig *GCPManagedNetworkConfig `json:"gcp_managed_network_config"`
99-
GCPCommonNetworkConfig *GCPManagedNetworkConfig `json:"gcp_common_network_config"`
99+
GCPCommonNetworkConfig *GCPCommonNetworkConfig `json:"gcp_common_network_config"`
100100
}
101101

102102
// Workspace is the object that contains all the information for deploying a workspace

mws/resource_workspace_test.go

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,18 @@ func TestResourceWorkspaceCreateGcp(t *testing.T) {
129129
"project_id": "def",
130130
},
131131
},
132-
"location": "bcd",
132+
"location": "bcd",
133+
"network": map[string]interface{}{
134+
"gcp_common_network_config": map[string]interface{}{
135+
"gke_cluster_master_ip_range": "e",
136+
"gke_connectivity_type": "d",
137+
},
138+
"gcp_managed_network_config": map[string]interface{}{
139+
"gke_cluster_pod_ip_range": "b",
140+
"gke_cluster_service_ip_range": "c",
141+
"subnet_cidr": "a",
142+
},
143+
},
133144
"workspace_name": "labdata",
134145
},
135146
Response: Workspace{
@@ -162,7 +173,19 @@ func TestResourceWorkspaceCreateGcp(t *testing.T) {
162173
gcp {
163174
project_id = "def"
164175
}
165-
}`,
176+
}
177+
network {
178+
gcp_managed_network_config {
179+
subnet_cidr = "a"
180+
gke_cluster_pod_ip_range = "b"
181+
gke_cluster_service_ip_range = "c"
182+
}
183+
gcp_common_network_config {
184+
gke_connectivity_type = "d"
185+
gke_cluster_master_ip_range = "e"
186+
}
187+
}
188+
`,
166189
Gcp: true,
167190
Create: true,
168191
}.ApplyNoError(t)

0 commit comments

Comments
 (0)