Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 4 additions & 24 deletions internal/services/container/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/container"
containerchecks "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/container/testfuncs"
)

func TestAccContainer_Basic(t *testing.T) {
Expand Down Expand Up @@ -226,25 +225,6 @@ func TestAccContainer_WithIMG(t *testing.T) {
ProviderFactories: tt.ProviderFactories,
CheckDestroy: isContainerDestroyed(tt),
Steps: []resource.TestStep{
{
Config: fmt.Sprintf(`
resource scaleway_container_namespace main {
name = "%s"
description = "test container"
}
`, containerNamespace),
},
{
Config: fmt.Sprintf(`
resource scaleway_container_namespace main {
name = "%s"
description = "test container"
}
`, containerNamespace),
Check: resource.ComposeTestCheckFunc(
containerchecks.TestConfigContainerNamespace(tt, "scaleway_container_namespace.main"),
),
},
{
Config: fmt.Sprintf(`
resource scaleway_container_namespace main {
Expand All @@ -256,7 +236,7 @@ func TestAccContainer_WithIMG(t *testing.T) {
name = "my-container-02"
description = "environment variables test"
namespace_id = scaleway_container_namespace.main.id
registry_image = "${scaleway_container_namespace.main.registry_endpoint}/nginx:test"
registry_image = "nginx:latest"
port = 80
cpu_limit = 140
memory_limit = 256
Expand Down Expand Up @@ -501,7 +481,7 @@ func TestAccContainer_ScalingOption(t *testing.T) {
{
Config: `
resource scaleway_container_namespace main {}

resource scaleway_container main {
namespace_id = scaleway_container_namespace.main.id
deploy = false
Expand All @@ -520,7 +500,7 @@ func TestAccContainer_ScalingOption(t *testing.T) {
{
Config: `
resource scaleway_container_namespace main {}

resource scaleway_container main {
namespace_id = scaleway_container_namespace.main.id
deploy = false
Expand All @@ -542,7 +522,7 @@ func TestAccContainer_ScalingOption(t *testing.T) {
{
Config: `
resource scaleway_container_namespace main {}

resource scaleway_container main {
namespace_id = scaleway_container_namespace.main.id
deploy = false
Expand Down
9 changes: 1 addition & 8 deletions internal/services/container/domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/logging"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/container"
containerchecks "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/container/testfuncs"
)

func TestAccDomain_Basic(t *testing.T) {
Expand All @@ -26,18 +25,12 @@ func TestAccDomain_Basic(t *testing.T) {
ProviderFactories: tt.ProviderFactories,
CheckDestroy: isDomainDestroyed(tt),
Steps: []resource.TestStep{
{
Config: `
resource scaleway_container_namespace main {}
`,
Check: containerchecks.TestConfigContainerNamespace(tt, "scaleway_container_namespace.main"),
},
{
Config: fmt.Sprintf(`
resource scaleway_container_namespace main {}

resource scaleway_container app {
registry_image = "${scaleway_container_namespace.main.registry_endpoint}/nginx:test"
registry_image = "nginx:latest"
namespace_id = scaleway_container_namespace.main.id
port = 80
deploy = true
Expand Down
943 changes: 349 additions & 594 deletions internal/services/container/testdata/container-basic.cassette.yaml

Large diffs are not rendered by default.

497 changes: 224 additions & 273 deletions internal/services/container/testdata/container-with-img.cassette.yaml

Large diffs are not rendered by default.

3,477 changes: 489 additions & 2,988 deletions internal/services/container/testdata/domain-basic.cassette.yaml

Large diffs are not rendered by default.

143 changes: 0 additions & 143 deletions internal/services/container/testfuncs/checks.go

This file was deleted.

19 changes: 2 additions & 17 deletions internal/services/function/domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/logging"
containerchecks "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/container/testfuncs"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/function"
)

Expand All @@ -26,21 +25,6 @@ func TestAccFunctionDomain_Basic(t *testing.T) {
ProviderFactories: tt.ProviderFactories,
CheckDestroy: testAccCheckFunctionDomainDestroy(tt),
Steps: []resource.TestStep{
{
Config: `
resource scaleway_function_namespace main {}

resource scaleway_function main {
namespace_id = scaleway_function_namespace.main.id
runtime = "go122"
privacy = "private"
handler = "Handle"
zip_file = "testfixture/gofunction.zip"
deploy = true
}
`,
Check: containerchecks.TestConfigContainerNamespace(tt, "scaleway_function_namespace.main"),
},
{
Config: fmt.Sprintf(`
resource scaleway_function_namespace main {}
Expand All @@ -56,7 +40,7 @@ func TestAccFunctionDomain_Basic(t *testing.T) {

resource scaleway_domain_record "function" {
dns_zone = "%s"
name = "container"
name = "function"
type = "CNAME"
data = "${scaleway_function.main.domain_name}."
ttl = 60
Expand All @@ -69,6 +53,7 @@ func TestAccFunctionDomain_Basic(t *testing.T) {
`, testDNSZone),
Check: resource.ComposeTestCheckFunc(
testAccCheckFunctionDomainExists(tt, "scaleway_function_domain.main"),
resource.TestCheckResourceAttr("scaleway_function_domain.main", "hostname", fmt.Sprintf("%s.%s", "function", testDNSZone)),
),
},
},
Expand Down
Loading
Loading