Skip to content

Commit

Permalink
refactor(test): use new muxed provider for all acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
apricote authored and jooola committed Sep 19, 2023
1 parent d2f9568 commit 2a407c8
Show file tree
Hide file tree
Showing 34 changed files with 298 additions and 278 deletions.
12 changes: 6 additions & 6 deletions internal/e2etests/certificate/data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ func TestAccHcloudDataSourceCertificateTest(t *testing.T) {
certificateBySel.SetRName("certificate_by_sel")

resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(certificate.ResourceType, certificate.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(certificate.ResourceType, certificate.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down Expand Up @@ -78,9 +78,9 @@ func TestAccHcloudDataSourceCertificateListTest(t *testing.T) {

tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(certificate.ResourceType, certificate.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(certificate.ResourceType, certificate.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down
18 changes: 9 additions & 9 deletions internal/e2etests/certificate/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ func TestCertificateResource_Uploaded_Basic(t *testing.T) {
tmplMan := testtemplate.Manager{}
// Not parallel because number of certificates per domain is limited
resource.Test(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(certificate.UploadedResourceType, certificate.ByID(t, &cert)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(certificate.UploadedResourceType, certificate.ByID(t, &cert)),
Steps: []resource.TestStep{
{
// Create a new Certificate using the required values
Expand Down Expand Up @@ -77,9 +77,9 @@ func TestCertificateResource_Uploaded_ChangeCertRequiresNewResource(t *testing.T
tmplMan := testtemplate.Manager{}
// Not parallel because number of certificates per domain is limited
resource.Test(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(certificate.UploadedResourceType, certificate.ByID(t, &cert)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(certificate.UploadedResourceType, certificate.ByID(t, &cert)),
Steps: []resource.TestStep{
{
// Create a new Certificate using the required values
Expand Down Expand Up @@ -132,9 +132,9 @@ func TestCertificateResource_Managed_Basic(t *testing.T) {
tmplMan := testtemplate.Manager{}
// Not parallel because number of certificates per domain is limited
resource.Test(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(certificate.ManagedResourceType, certificate.ByID(t, &cert)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(certificate.ManagedResourceType, certificate.ByID(t, &cert)),
Steps: []resource.TestStep{
{
// Create a new Certificate using the required values
Expand Down
8 changes: 4 additions & 4 deletions internal/e2etests/datacenter/data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func TestAccHcloudDataSourceDatacenterTest(t *testing.T) {
}
dcByID.SetRName("dc_by_id")
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
ProviderFactories: e2etests.ProviderFactories(),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand All @@ -49,8 +49,8 @@ func TestAccHcloudDataSourceDatacentersTest(t *testing.T) {
datacentersD := &datacenter.DDataList{}
datacentersD.SetRName("ds")
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
ProviderFactories: e2etests.ProviderFactories(),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down
8 changes: 4 additions & 4 deletions internal/e2etests/firewall/attachment_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func TestAttachmentResource_Servers(t *testing.T) {

tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: resource.ComposeAggregateTestCheckFunc(
testsupport.CheckResourcesDestroyed(server.ResourceType, server.ByID(t, &srv)),
testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, &fw)),
Expand Down Expand Up @@ -76,8 +76,8 @@ func TestAttachmentResource_LabelSelectors(t *testing.T) {

tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: resource.ComposeAggregateTestCheckFunc(
testsupport.CheckResourcesDestroyed(server.ResourceType, server.ByID(t, &srv)),
testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, &fw)),
Expand Down
12 changes: 6 additions & 6 deletions internal/e2etests/firewall/data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func TestAccHcloudDataSourceFirewallTest(t *testing.T) {

// TODO: Move to parallel test once API endpoint is fixed
resource.Test(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down Expand Up @@ -78,9 +78,9 @@ func TestAccHcloudDataSourceFirewallListTest(t *testing.T) {
tmplMan := testtemplate.Manager{}
// TODO: Move to parallel test once API endpoint is fixed
resource.Test(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down
24 changes: 12 additions & 12 deletions internal/e2etests/firewall/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ func TestFirewallResource_Basic(t *testing.T) {
tmplMan := testtemplate.Manager{}
// TODO: Move to parallel test once API endpoint is fixed
resource.Test(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, &f)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, &f)),
Steps: []resource.TestStep{
{
// Create a new Firewall using the required values
Expand Down Expand Up @@ -147,9 +147,9 @@ func TestFirewallResource_ApplyTo(t *testing.T) {
tmplMan := testtemplate.Manager{}
// TODO: Move to parallel test once API endpoint is fixed
resource.Test(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, &f)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, &f)),
Steps: []resource.TestStep{
{
// Create a new Firewall using the required values
Expand Down Expand Up @@ -195,9 +195,9 @@ func TestFirewallResource_SourceIPs_IPv6Comparison(t *testing.T) {

// TODO: Move to parallel test once API endpoint is fixed
resource.Test(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, &f)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, &f)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t, "testdata/r/hcloud_firewall", res),
Expand Down Expand Up @@ -228,9 +228,9 @@ func TestFirewallResource_DestinationIPs_IPv6Comparison(t *testing.T) {

// TODO: Move to parallel test once API endpoint is fixed
resource.Test(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, &f)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(firewall.ResourceType, firewall.ByID(t, &f)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t, "testdata/r/hcloud_firewall", res),
Expand Down
12 changes: 6 additions & 6 deletions internal/e2etests/floatingip/data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ func TestAccHcloudDataSourceFloatingIPTest(t *testing.T) {
floatingipBySel.SetRName("floatingip_by_sel")

resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(floatingip.ResourceType, floatingip.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(floatingip.ResourceType, floatingip.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down Expand Up @@ -96,9 +96,9 @@ func TestAccHcloudDataSourceFloatingIPListTest(t *testing.T) {

tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(floatingip.ResourceType, floatingip.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(floatingip.ResourceType, floatingip.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down
6 changes: 3 additions & 3 deletions internal/e2etests/floatingip/resource_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ func TestFloatingIPAssignmentResource_Basic(t *testing.T) {
ServerID: resServer2.TFID() + ".id",
}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(server.ResourceType, server.ByID(t, &s)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(server.ResourceType, server.ByID(t, &s)),
Steps: []resource.TestStep{
{
// Create a new RDNS using the required values
Expand Down
18 changes: 9 additions & 9 deletions internal/e2etests/floatingip/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func TestFloatingIPResource_Basic(t *testing.T) {
resRenamed.SetRName(res.Name)
tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(floatingip.ResourceType, floatingip.ByID(t, &fip)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(floatingip.ResourceType, floatingip.ByID(t, &fip)),
Steps: []resource.TestStep{
{
// Create a new Floating IP using the required values
Expand Down Expand Up @@ -89,9 +89,9 @@ func TestFloatingIPResource_WithServer(t *testing.T) {
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(floatingip.ResourceType, floatingip.ByID(t, &fip)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(floatingip.ResourceType, floatingip.ByID(t, &fip)),
Steps: []resource.TestStep{
{
// Create a new Floating IP using the required values
Expand Down Expand Up @@ -137,9 +137,9 @@ func TestFloatingIPResource_Protection(t *testing.T) {

tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(floatingip.ResourceType, floatingip.ByID(t, &fip)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(floatingip.ResourceType, floatingip.ByID(t, &fip)),
Steps: []resource.TestStep{
{
// Create a new Floating IP using the required values
Expand Down
18 changes: 9 additions & 9 deletions internal/e2etests/image/data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ func TestAccHcloudDataSourceImageTest(t *testing.T) {
imageByID.SetRName("image_by_id")

resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down Expand Up @@ -63,9 +63,9 @@ func TestAccHcloudDataSourceImageWithFiltersTest(t *testing.T) {
imageByName.SetRName("image_by_name")

resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
ProviderFactories: e2etests.ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand All @@ -89,9 +89,9 @@ func TestAccHcloudDataSourceImageListTest(t *testing.T) {

tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down
12 changes: 6 additions & 6 deletions internal/e2etests/loadbalancer/data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ func TestAccHcloudDataSourceLoadBalancerTest(t *testing.T) {
lbBySel.SetRName("lb_by_sel")

resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down Expand Up @@ -98,9 +98,9 @@ func TestAccHcloudDataSourceLoadBalancerListTest(t *testing.T) {

tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down
18 changes: 9 additions & 9 deletions internal/e2etests/loadbalancer/resource_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func TestAccHcloudLoadBalancerNetwork_NetworkID(t *testing.T) {

tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down Expand Up @@ -127,9 +127,9 @@ func TestAccHcloudLoadBalancerNetwork_SubNetID(t *testing.T) {

tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down Expand Up @@ -180,9 +180,9 @@ func TestAccHcloudLoadBalancerNetwork_CannotAttachToTwoNetworks(t *testing.T) {

tmplMan := testtemplate.Manager{}
resource.ParallelTest(t, resource.TestCase{
PreCheck: e2etests.PreCheck(t),
Providers: e2etests.Providers(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
PreCheck: e2etests.PreCheck(t),
ProtoV6ProviderFactories: e2etests.ProtoV6ProviderFactories(),
CheckDestroy: testsupport.CheckResourcesDestroyed(loadbalancer.ResourceType, loadbalancer.ByID(t, nil)),
Steps: []resource.TestStep{
{
Config: tmplMan.Render(t,
Expand Down
Loading

0 comments on commit 2a407c8

Please sign in to comment.