Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-henglu committed Jul 25, 2024
1 parent 7bfb838 commit 0e544fe
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 31 deletions.
126 changes: 110 additions & 16 deletions internal/langserver/handlers/testdata/TestExecuteCommand_basic/expect.tf
Original file line number Diff line number Diff line change
@@ -1,37 +1,131 @@
/*
Note: This is a generated HCL content from the JSON input which is based on the latest API version available.
To import the resource, please run the following command:
terraform import azapi_resource.automationAccount /subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctest1660/providers/Microsoft.Automation/automationAccounts/hengluacctest5030?api-version=2023-11-01
terraform import azapi_resource.managedCluster /subscriptions/0000000/resourcegroups/acctestRG-aks-240626160102776968/providers/Microsoft.ContainerService/managedClusters/acctestaks240626160102776968?api-version=2024-04-02-preview
Or add the below config:
import {
id = "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctest1660/providers/Microsoft.Automation/automationAccounts/hengluacctest5030?api-version=2023-11-01"
to = azapi_resource.automationAccount
id = "/subscriptions/0000000/resourcegroups/acctestRG-aks-240626160102776968/providers/Microsoft.ContainerService/managedClusters/acctestaks240626160102776968?api-version=2024-04-02-preview"
to = azapi_resource.managedCluster
}
*/

resource "azapi_resource" "automationAccount" {
type = "Microsoft.Automation/automationAccounts@2023-11-01"
parent_id = "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctest1660"
name = "hengluacctest5030"
location = "westeurope"
resource "azapi_resource" "managedCluster" {
type = "Microsoft.ContainerService/managedClusters@2024-04-02-preview"
parent_id = "/subscriptions/0000000/resourceGroups/acctestRG-aks-240626160102776968"
name = "acctestaks240626160102776968"
location = "eastus"
identity {
type = "SystemAssigned"
identity_ids = []
}
body = {
properties = {
encryption = {
identity = {
userAssignedIdentity = null
agentPoolProfiles = [{
count = 3
enableAutoScaling = false
enableEncryptionAtHost = false
enableFIPS = false
enableNodePublicIP = false
enableUltraSSD = false
kubeletDiskType = "OS"
maxPods = 30
mode = "System"
name = "np"
orchestratorVersion = "1.28"
osDiskSizeGB = 128
osDiskType = "Managed"
osSKU = "Ubuntu"
osType = "Linux"
powerState = {
code = "Running"
}
scaleDownMode = "Delete"
type = "VirtualMachineScaleSets"
upgradeSettings = {
maxSurge = "10%"
}
vmSize = "Standard_DS2_v2"
}]
autoUpgradeProfile = {
nodeOSUpgradeChannel = "NodeImage"
upgradeChannel = "none"
}
azureMonitorProfile = {
metrics = {
enabled = false
kubeStateMetrics = {}
}
}
disableLocalAccounts = false
dnsPrefix = "acctestaks240626160102776968"
enableRBAC = true
kubernetesVersion = "1.28"
linuxProfile = {
adminUsername = "acctestuser240626160102776968"
ssh = {
publicKeys = [{
keyData = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt [email protected]"
}]
}
keySource = "Microsoft.Automation"
}
sku = {
capacity = null
family = null
name = "Basic"
networkProfile = {
dnsServiceIP = "10.10.0.10"
ipFamilies = ["IPv4"]
loadBalancerProfile = {
backendPoolType = "nodeIPConfiguration"
managedOutboundIPs = {
count = 1
}
}
loadBalancerSku = "standard"
networkDataplane = "azure"
networkPlugin = "azure"
networkPolicy = "azure"
outboundType = "loadBalancer"
serviceCidr = "10.10.0.0/16"
serviceCidrs = ["10.10.0.0/16"]
}
nodeResourceGroup = "MC_acctestRG-aks-240626160102776968_acctestaks240626160102776968_eastus"
oidcIssuerProfile = {
enabled = false
}
securityProfile = {
imageCleaner = {
enabled = false
intervalHours = 48
}
}
servicePrincipalProfile = {
clientId = "msi"
}
storageProfile = {
diskCSIDriver = {
enabled = true
}
fileCSIDriver = {
enabled = true
}
snapshotController = {
enabled = true
}
}
supportPlan = "KubernetesOfficial"
windowsProfile = {
adminUsername = "azureuser"
enableCSIProxy = true
gmsaProfile = {
dnsServer = ""
enabled = true
rootDomainName = ""
}
licenseType = "None"
}
workloadAutoScalerProfile = {}
}
sku = {
name = "Base"
tier = "Free"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/acctestRG-aks-240626160102776968/providers/Microsoft.ContainerService/managedClusters/acctestaks240626160102776968",
"id": "/subscriptions/0000000/resourcegroups/acctestRG-aks-240626160102776968/providers/Microsoft.ContainerService/managedClusters/acctestaks240626160102776968",
"location": "eastus",
"name": "acctestaks240626160102776968",
"type": "Microsoft.ContainerService/ManagedClusters",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/*
Note: This is a generated HCL content from the JSON input which is based on the latest API version available.
To import the resource, please run the following command:
terraform import azapi_resource.subnet /subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447/subnets/acctest-sn-private-240530173443928447?api-version=2023-11-01
terraform import azapi_resource.subnet /subscriptions/0000000/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447/subnets/acctest-sn-private-240530173443928447?api-version=2024-01-01
Or add the below config:
import {
id = "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447/subnets/acctest-sn-private-240530173443928447?api-version=2023-11-01"
id = "/subscriptions/0000000/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447/subnets/acctest-sn-private-240530173443928447?api-version=2024-01-01"
to = azapi_resource.subnet
}
*/

resource "azapi_resource" "subnet" {
type = "Microsoft.Network/virtualNetworks/subnets@2023-11-01"
parent_id = "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447"
type = "Microsoft.Network/virtualNetworks/subnets@2024-01-01"
parent_id = "/subscriptions/0000000/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447"
name = "acctest-sn-private-240530173443928447"
body = {
properties = {
addressPrefix = "10.0.2.0/24"
delegations = [{
id = "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447/subnets/acctest-sn-private-240530173443928447/delegations/acctest"
id = "/subscriptions/0000000/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447/subnets/acctest-sn-private-240530173443928447/delegations/acctest"
name = "acctest"
properties = {
serviceName = "Microsoft.Databricks/workspaces"
}
type = "Microsoft.Network/virtualNetworks/subnets/delegations"
}]
networkSecurityGroup = {
id = "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/networkSecurityGroups/acctest-nsg-240530173443928447"
id = "/subscriptions/0000000/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/networkSecurityGroups/acctest-nsg-240530173443928447"
}
privateEndpointNetworkPolicies = "Enabled"
privateLinkServiceNetworkPolicies = "Enabled"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "acctest-sn-private-240530173443928447",
"id": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447/subnets/acctest-sn-private-240530173443928447",
"id": "/subscriptions/0000000/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447/subnets/acctest-sn-private-240530173443928447",
"etag": "W/\"b1dbffb3-0a4f-42a8-ac22-0b6a04d76810\"",
"properties": {
"provisioningState": "Succeeded",
"addressPrefix": "10.0.2.0/24",
"networkSecurityGroup": {
"id": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/networkSecurityGroups/acctest-nsg-240530173443928447"
"id": "/subscriptions/0000000/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/networkSecurityGroups/acctest-nsg-240530173443928447"
},
"networkIntentPolicies": [
{
"id": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ACCTESTRG-DATABRICKS-240530173443928447/providers/Microsoft.Network/networkIntentPolicies/ADB-EASTUS-DP-TO-CP-PL-2D0CEECC9F3EDAAC0D844BB8"
"id": "/subscriptions/0000000/resourceGroups/ACCTESTRG-DATABRICKS-240530173443928447/providers/Microsoft.Network/networkIntentPolicies/ADB-EASTUS-DP-TO-CP-PL-2D0CEECC9F3EDAAC0D844BB8"
}
],
"serviceEndpoints": [],
"delegations": [
{
"name": "acctest",
"id": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447/subnets/acctest-sn-private-240530173443928447/delegations/acctest",
"id": "/subscriptions/0000000/resourceGroups/acctestRG-databricks-240530173443928447/providers/Microsoft.Network/virtualNetworks/acctest-vnet-240530173443928447/subnets/acctest-sn-private-240530173443928447/delegations/acctest",
"etag": "W/\"b1dbffb3-0a4f-42a8-ac22-0b6a04d76810\"",
"properties": {
"provisioningState": "Succeeded",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
Note: This is a generated HCL content from the JSON input which is based on the latest API version available.
To import the resource, please run the following command:
terraform import azapi_resource.resourceGroup /subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/app-rg5wg5lo7sa2hxrh6bs6?api-version=2024-03-01
terraform import azapi_resource.resourceGroup /subscriptions/0000000/resourceGroups/app-rg5wg5lo7sa2hxrh6bs6?api-version=2024-03-01
Or add the below config:
import {
id = "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/app-rg5wg5lo7sa2hxrh6bs6?api-version=2024-03-01"
id = "/subscriptions/0000000/resourceGroups/app-rg5wg5lo7sa2hxrh6bs6?api-version=2024-03-01"
to = azapi_resource.resourceGroup
}
*/

resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2024-03-01"
parent_id = "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590"
parent_id = "/subscriptions/0000000"
name = "app-rg5wg5lo7sa2hxrh6bs6"
location = "eastus"
body = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/app-rg5wg5lo7sa2hxrh6bs6",
"id": "/subscriptions/0000000/resourceGroups/app-rg5wg5lo7sa2hxrh6bs6",
"name": "app-rg5wg5lo7sa2hxrh6bs6",
"type": "Microsoft.Resources/resourceGroups",
"location": "eastus",
Expand Down

0 comments on commit 0e544fe

Please sign in to comment.