Skip to content

Commit 59ca314

Browse files
committed
namespace test ok
1 parent a20474d commit 59ca314

File tree

2 files changed

+3171
-18
lines changed

2 files changed

+3171
-18
lines changed

internal/services/function/namespace_test.go

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package function_test
22

33
import (
44
"fmt"
5+
"regexp"
56
"testing"
67

78
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -198,11 +199,12 @@ func TestAccFunctionNamespace_VPCIntegration(t *testing.T) {
198199
{
199200
Config: `
200201
resource scaleway_vpc_private_network main {}
201-
202+
202203
resource scaleway_function_namespace main {}
203-
204+
204205
resource scaleway_function main {
205206
namespace_id = scaleway_function_namespace.main.id
207+
sandbox = "v1"
206208
privacy = "private"
207209
runtime = "go123"
208210
handler = "Handle"
@@ -214,22 +216,23 @@ func TestAccFunctionNamespace_VPCIntegration(t *testing.T) {
214216
acctest.CheckResourceIDPersisted("scaleway_function_namespace.main", &namespaceID),
215217
),
216218
},
217-
//{
218-
// Config: `
219-
// resource scaleway_vpc_private_network main {}
220-
//
221-
// resource scaleway_function_namespace main {}
222-
//
223-
// resource scaleway_function main {
224-
// namespace_id = scaleway_function_namespace.main.id
225-
// privacy = "private"
226-
// runtime = "go123"
227-
// handler = "Handle"
228-
// private_network_id = scaleway_vpc_private_network.main.id
229-
// }
230-
// `,
231-
// ExpectError: regexp.MustCompile("Application can't be attached to private network, vpc integration must be activated on its parent namespace"),
232-
//},
219+
{
220+
Config: `
221+
resource scaleway_vpc_private_network main {}
222+
223+
resource scaleway_function_namespace main {}
224+
225+
resource scaleway_function main {
226+
namespace_id = scaleway_function_namespace.main.id
227+
privacy = "private"
228+
sandbox = "v1"
229+
runtime = "go123"
230+
handler = "Handle"
231+
private_network_id = scaleway_vpc_private_network.main.id
232+
}
233+
`,
234+
ExpectError: regexp.MustCompile("Application can't be attached to private network, vpc integration must be activated on its parent namespace"),
235+
},
233236
{
234237
Config: `
235238
resource scaleway_vpc_private_network main {}
@@ -240,6 +243,7 @@ func TestAccFunctionNamespace_VPCIntegration(t *testing.T) {
240243
241244
resource scaleway_function main {
242245
namespace_id = scaleway_function_namespace.main.id
246+
sandbox = "v1"
243247
privacy = "private"
244248
runtime = "go123"
245249
handler = "Handle"

0 commit comments

Comments
 (0)