From 34b5ff91099adb1456ce3b735a159df470833674 Mon Sep 17 00:00:00 2001 From: Hilton Lem <101275725+hiltol@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:59:49 -0400 Subject: [PATCH] fix ibm unit tests (#192) * update ibm tests * fix tf format --- .../testdata/cloudant_test/cloudant_test.tf | 3 +-- .../container_vpc_cluster_test.tf | 3 +-- .../container_vpc_worker_pool_test.golden | 4 ++-- .../container_vpc_worker_pool_test.tf | 3 +-- .../database_test/database_test.golden | 18 +++++++++--------- .../testdata/database_test/database_test.tf | 5 ++--- .../ibm_cos_bucket_test/ibm_cos_bucket_test.tf | 3 +-- .../ibm_is_vpc_test/ibm_is_vpc_test.tf | 3 +-- .../ibm_pi_volume_test/ibm_pi_volume_test.tf | 3 +-- .../is_floating_ip_test/is_floating_ip_test.tf | 3 +-- .../is_flow_log_test/is_flow_log_test.golden | 6 ++++-- .../is_flow_log_test/is_flow_log_test.tf | 3 +-- .../is_instance_test/is_instance_test.tf | 3 +-- .../ibm/testdata/is_lb_test/is_lb_test.tf | 3 +-- .../testdata/is_share_test/is_share_test.tf | 3 +-- .../testdata/is_volume_test/is_volume_test.tf | 3 +-- .../is_vpn_gateway_test/is_vpn_gateway_test.tf | 3 +-- .../is_vpn_server_test/is_vpn_server_test.tf | 3 +-- .../pi_instance_test/pi_instance_test.tf | 13 ++++++------- .../resource_instance_test.tf | 3 +-- .../tg_gateway_test/tg_gateway_test.tf | 3 +-- 21 files changed, 39 insertions(+), 55 deletions(-) diff --git a/internal/providers/terraform/ibm/testdata/cloudant_test/cloudant_test.tf b/internal/providers/terraform/ibm/testdata/cloudant_test/cloudant_test.tf index b3e0910f509..3bc5140267b 100644 --- a/internal/providers/terraform/ibm/testdata/cloudant_test/cloudant_test.tf +++ b/internal/providers/terraform/ibm/testdata/cloudant_test/cloudant_test.tf @@ -2,8 +2,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/container_vpc_cluster_test/container_vpc_cluster_test.tf b/internal/providers/terraform/ibm/testdata/container_vpc_cluster_test/container_vpc_cluster_test.tf index 4448e2357f9..3f589080e76 100644 --- a/internal/providers/terraform/ibm/testdata/container_vpc_cluster_test/container_vpc_cluster_test.tf +++ b/internal/providers/terraform/ibm/testdata/container_vpc_cluster_test/container_vpc_cluster_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/container_vpc_worker_pool_test/container_vpc_worker_pool_test.golden b/internal/providers/terraform/ibm/testdata/container_vpc_worker_pool_test/container_vpc_worker_pool_test.golden index f445dde4a2a..5589a09b361 100644 --- a/internal/providers/terraform/ibm/testdata/container_vpc_worker_pool_test/container_vpc_worker_pool_test.golden +++ b/internal/providers/terraform/ibm/testdata/container_vpc_worker_pool_test/container_vpc_worker_pool_test.golden @@ -16,9 +16,9 @@ └─ VPC egress eu-de (over 149995 GB) 0 GB $0.00 mycluster - └─ VPC Container Work Zone flavor: (bx2.4x16) region: (eu-de) name: (eu-de-1) x(3) workers 2,190 hours $682.31 + └─ VPC Container Work Zone flavor: (bx2.4x16) region: (eu-de) name: (eu-de-1) x(3) workers 2,190 hours $665.19 - OVERALL TOTAL $5,816.13 + OVERALL TOTAL $5,799.01 ────────────────────────────────── 6 cloud resources were detected: ∙ 4 were estimated, 3 of which include usage-based costs, see https://infracost.io/usage-file diff --git a/internal/providers/terraform/ibm/testdata/container_vpc_worker_pool_test/container_vpc_worker_pool_test.tf b/internal/providers/terraform/ibm/testdata/container_vpc_worker_pool_test/container_vpc_worker_pool_test.tf index b84f2e33839..dd03844cbc5 100644 --- a/internal/providers/terraform/ibm/testdata/container_vpc_worker_pool_test/container_vpc_worker_pool_test.tf +++ b/internal/providers/terraform/ibm/testdata/container_vpc_worker_pool_test/container_vpc_worker_pool_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/database_test/database_test.golden b/internal/providers/terraform/ibm/testdata/database_test/database_test.golden index 1069e02cbe0..46312f60b90 100644 --- a/internal/providers/terraform/ibm/testdata/database_test/database_test.golden +++ b/internal/providers/terraform/ibm/testdata/database_test/database_test.golden @@ -30,15 +30,15 @@ └─ Disk (over 0 GB-DISK) 1 GB-DISK $0.63 ibm_database.test_es_platinum_db1 - ├─ RAM 36 GB-RAM $939.60 - ├─ Disk 384 GB-DISK $234.24 - └─ Core 9 Virtual Processor Core $282.60 + ├─ RAM 36 GB-RAM $967.79 + ├─ Disk 384 GB-DISK $241.27 + └─ Core 9 Virtual Processor Core $291.08 ibm_database.test_es_platinum_db2 - ├─ RAM 4 GB-RAM $104.40 - └─ Disk 20 GB-DISK $12.20 - - OVERALL TOTAL $1,790.45 + ├─ RAM 4 GB-RAM $107.53 + └─ Disk 20 GB-DISK $12.57 + + OVERALL TOTAL $1,837.64 ────────────────────────────────── -4 cloud resources were detected: -∙ 4 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file +6 cloud resources were detected: +∙ 6 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file \ No newline at end of file diff --git a/internal/providers/terraform/ibm/testdata/database_test/database_test.tf b/internal/providers/terraform/ibm/testdata/database_test/database_test.tf index 8512d4c0e0b..35f55084f6d 100644 --- a/internal/providers/terraform/ibm/testdata/database_test/database_test.tf +++ b/internal/providers/terraform/ibm/testdata/database_test/database_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } @@ -127,7 +126,7 @@ resource "ibm_database" "test_es_platinum_db2" { allocation_count = 4 } memory { - allocation_mb = 1024 + allocation_mb = 2048 } } } diff --git a/internal/providers/terraform/ibm/testdata/ibm_cos_bucket_test/ibm_cos_bucket_test.tf b/internal/providers/terraform/ibm/testdata/ibm_cos_bucket_test/ibm_cos_bucket_test.tf index 1cb3c87a45d..f38f146610b 100644 --- a/internal/providers/terraform/ibm/testdata/ibm_cos_bucket_test/ibm_cos_bucket_test.tf +++ b/internal/providers/terraform/ibm/testdata/ibm_cos_bucket_test/ibm_cos_bucket_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/ibm_is_vpc_test/ibm_is_vpc_test.tf b/internal/providers/terraform/ibm/testdata/ibm_is_vpc_test/ibm_is_vpc_test.tf index 5660081d3cd..9de6a4ff46f 100644 --- a/internal/providers/terraform/ibm/testdata/ibm_is_vpc_test/ibm_is_vpc_test.tf +++ b/internal/providers/terraform/ibm/testdata/ibm_is_vpc_test/ibm_is_vpc_test.tf @@ -2,8 +2,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/ibm_pi_volume_test/ibm_pi_volume_test.tf b/internal/providers/terraform/ibm/testdata/ibm_pi_volume_test/ibm_pi_volume_test.tf index b900f3d4e8e..6bd1a525dc2 100644 --- a/internal/providers/terraform/ibm/testdata/ibm_pi_volume_test/ibm_pi_volume_test.tf +++ b/internal/providers/terraform/ibm/testdata/ibm_pi_volume_test/ibm_pi_volume_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/is_floating_ip_test/is_floating_ip_test.tf b/internal/providers/terraform/ibm/testdata/is_floating_ip_test/is_floating_ip_test.tf index b944473d328..5068764c63e 100644 --- a/internal/providers/terraform/ibm/testdata/is_floating_ip_test/is_floating_ip_test.tf +++ b/internal/providers/terraform/ibm/testdata/is_floating_ip_test/is_floating_ip_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/is_flow_log_test/is_flow_log_test.golden b/internal/providers/terraform/ibm/testdata/is_flow_log_test/is_flow_log_test.golden index 10138282290..3c97208623c 100644 --- a/internal/providers/terraform/ibm/testdata/is_flow_log_test/is_flow_log_test.golden +++ b/internal/providers/terraform/ibm/testdata/is_flow_log_test/is_flow_log_test.golden @@ -27,8 +27,10 @@ └─ Flow Log Collector us-south (over 72000 GB) Monthly cost depends on usage: $0.10 per GB ibm_is_instance.testIsInstance - ├─ CPU hours (2 CPUs, us-south-1) Monthly cost depends on usage: $0.0249876337 per CPU hours - └─ Memory hours (8 GB, us-south-1) Monthly cost depends on usage: $0.00506833 per Memory hours + ├─ CPU hours (2 CPUs, us-south-1) (first 1 CPU hours) Monthly cost depends on usage: $0.31 per CPU hours + ├─ CPU hours (2 CPUs, us-south-1) (over 0 CPU hours) Monthly cost depends on usage: $0.0249876337 per CPU hours + └─ Memory hours (8 GB, us-south-1) (first 1 Memory hours) Monthly cost depends on usage: $0.57 per Memory hours + └─ Memory hours (8 GB, us-south-1) (over 0 Memory hours) Monthly cost depends on usage: $0.00506833 per Memory hours ibm_is_vpc.testVpc ├─ VPC instance 1 Instance $0.00 diff --git a/internal/providers/terraform/ibm/testdata/is_flow_log_test/is_flow_log_test.tf b/internal/providers/terraform/ibm/testdata/is_flow_log_test/is_flow_log_test.tf index fbf68223ece..3d8a95ce820 100644 --- a/internal/providers/terraform/ibm/testdata/is_flow_log_test/is_flow_log_test.tf +++ b/internal/providers/terraform/ibm/testdata/is_flow_log_test/is_flow_log_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/is_instance_test/is_instance_test.tf b/internal/providers/terraform/ibm/testdata/is_instance_test/is_instance_test.tf index 10be1c5eb31..bf33e413153 100644 --- a/internal/providers/terraform/ibm/testdata/is_instance_test/is_instance_test.tf +++ b/internal/providers/terraform/ibm/testdata/is_instance_test/is_instance_test.tf @@ -2,8 +2,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/is_lb_test/is_lb_test.tf b/internal/providers/terraform/ibm/testdata/is_lb_test/is_lb_test.tf index ed3bf4fc7f5..834bd5d0e96 100644 --- a/internal/providers/terraform/ibm/testdata/is_lb_test/is_lb_test.tf +++ b/internal/providers/terraform/ibm/testdata/is_lb_test/is_lb_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/is_share_test/is_share_test.tf b/internal/providers/terraform/ibm/testdata/is_share_test/is_share_test.tf index cf03b0bee3f..d03baad995c 100644 --- a/internal/providers/terraform/ibm/testdata/is_share_test/is_share_test.tf +++ b/internal/providers/terraform/ibm/testdata/is_share_test/is_share_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/is_volume_test/is_volume_test.tf b/internal/providers/terraform/ibm/testdata/is_volume_test/is_volume_test.tf index 354a33e4a8e..d733611c347 100644 --- a/internal/providers/terraform/ibm/testdata/is_volume_test/is_volume_test.tf +++ b/internal/providers/terraform/ibm/testdata/is_volume_test/is_volume_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/is_vpn_gateway_test/is_vpn_gateway_test.tf b/internal/providers/terraform/ibm/testdata/is_vpn_gateway_test/is_vpn_gateway_test.tf index 761d97a9562..645139b08f7 100644 --- a/internal/providers/terraform/ibm/testdata/is_vpn_gateway_test/is_vpn_gateway_test.tf +++ b/internal/providers/terraform/ibm/testdata/is_vpn_gateway_test/is_vpn_gateway_test.tf @@ -2,8 +2,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/is_vpn_server_test/is_vpn_server_test.tf b/internal/providers/terraform/ibm/testdata/is_vpn_server_test/is_vpn_server_test.tf index 915f5502a92..f0a309e4d2b 100644 --- a/internal/providers/terraform/ibm/testdata/is_vpn_server_test/is_vpn_server_test.tf +++ b/internal/providers/terraform/ibm/testdata/is_vpn_server_test/is_vpn_server_test.tf @@ -2,8 +2,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.69.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/pi_instance_test/pi_instance_test.tf b/internal/providers/terraform/ibm/testdata/pi_instance_test/pi_instance_test.tf index b20f46bdfed..e1a8e9e4177 100644 --- a/internal/providers/terraform/ibm/testdata/pi_instance_test/pi_instance_test.tf +++ b/internal/providers/terraform/ibm/testdata/pi_instance_test/pi_instance_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.58.0" + source = "IBM-Cloud/ibm" } } } @@ -81,7 +80,7 @@ resource "ibm_pi_instance" "aix-shared-s922-instance" { pi_instance_name = "aix-shared-s922" pi_proc_type = "shared" pi_image_id = ibm_pi_image.aix_image.id - pi_key_pair_name = ibm_pi_key.key.key_id + pi_key_pair_name = ibm_pi_key.key.id pi_sys_type = "s922" pi_cloud_instance_id = ibm_resource_instance.powervs_service.guid pi_pin_policy = "none" @@ -98,7 +97,7 @@ resource "ibm_pi_instance" "ibmi-dedicated-e980-instance" { pi_instance_name = "ibmi-dedicated-e980" pi_proc_type = "dedicated" pi_image_id = ibm_pi_image.ibmi_image.id - pi_key_pair_name = ibm_pi_key.key.key_id + pi_key_pair_name = ibm_pi_key.key.id pi_sys_type = "e980" pi_cloud_instance_id = ibm_resource_instance.powervs_service.guid pi_pin_policy = "none" @@ -112,7 +111,7 @@ resource "ibm_pi_instance" "ibmi-dedicated-e980-instance" { resource "ibm_pi_instance" "hana-dedicated-e980-instance" { pi_instance_name = "hana-dedicated-e980" pi_image_id = ibm_pi_image.hana_image.id - pi_key_pair_name = ibm_pi_key.key.key_id + pi_key_pair_name = ibm_pi_key.key.id pi_sys_type = "e980" pi_cloud_instance_id = ibm_resource_instance.powervs_service.guid pi_pin_policy = "none" @@ -130,7 +129,7 @@ resource "ibm_pi_instance" "netweaver-shared-s922-instance" { pi_instance_name = "netweaver-shared-s922" pi_proc_type = "shared" pi_image_id = ibm_pi_image.netweaver_image.id - pi_key_pair_name = ibm_pi_key.key.key_id + pi_key_pair_name = ibm_pi_key.key.id pi_sys_type = "s922" pi_cloud_instance_id = ibm_resource_instance.powervs_service.guid pi_pin_policy = "none" @@ -147,7 +146,7 @@ resource "ibm_pi_instance" "netweaver-shared-s922-no-usage-specified-instance" { pi_instance_name = "netweaver-shared-s922" pi_proc_type = "shared" pi_image_id = ibm_pi_image.netweaver_image.id - pi_key_pair_name = ibm_pi_key.key.key_id + pi_key_pair_name = ibm_pi_key.key.id pi_sys_type = "s922" pi_cloud_instance_id = ibm_resource_instance.powervs_service.guid pi_pin_policy = "none" diff --git a/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.tf b/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.tf index f8ba18282a5..3d96aabb015 100644 --- a/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.tf +++ b/internal/providers/terraform/ibm/testdata/resource_instance_test/resource_instance_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.64.0" + source = "IBM-Cloud/ibm" } } } diff --git a/internal/providers/terraform/ibm/testdata/tg_gateway_test/tg_gateway_test.tf b/internal/providers/terraform/ibm/testdata/tg_gateway_test/tg_gateway_test.tf index 39dc51b76cf..83be4ccbe52 100644 --- a/internal/providers/terraform/ibm/testdata/tg_gateway_test/tg_gateway_test.tf +++ b/internal/providers/terraform/ibm/testdata/tg_gateway_test/tg_gateway_test.tf @@ -1,8 +1,7 @@ terraform { required_providers { ibm = { - source = "IBM-Cloud/ibm" - version = "1.63.0" + source = "IBM-Cloud/ibm" } } }