-
Notifications
You must be signed in to change notification settings - Fork 25
Test Plan
- Get the extension's newest daily build from: https://vscjavaci.cloudapp.net/job/vscode_terraform/job/vscode_terraform_daily/
- Can install successfully.
- Icon, extension name, publisher, version is correct.
- Can see changelogs in extension information page
- Have Azure Account as the extension dependency in extension information page.
Prerequisite: To test extension features, we need to have a terraform project.
If you don't have one, find it from: https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/examples
Prerequisite: Running basic command locally requires users have terraform binary in the system path. See Running Terraform from Azure CLI for instructions on SPN setup.
NOTE: On Windows press F1
to open Command Palette. On Mac, press ⌘+SHIFT+P
to open Command Palette.
- Open the Command Palette.
- Select 'Terraform Azure: init'.
- Will run
terraform init
in the current workspace folder.
- Open the Command Palette.
- Select 'Terraform Azure: validate'.
- Will run
terraform validate
in the current workspace folder. - If there is syntax errors in the current terraform project, they will be shown as the command result.
- Open the Command Palette.
- Select 'Terraform Azure: plan'.
- Will run
terraform plan
in the current workspace folder. - The command will show what actions are necessary to achieve the desired state specified in the configuration files.
- Open the Command Palette.
- Select 'Terraform Azure: apply'.
- Will run
terraform apply
in the current workspace folder. - Will apply the changes required to reach the desired state of the configuration.
- Open the Command Palette.
- Select 'Terraform Azure: refresh'.
- Will run
terraform refresh
in the current workspace folder. - Will reconcile the state Terraform knows about (via its state file) with the real-world infrastructure.
- Open the Command Palette.
- Select 'Terraform Azure: destroy'.
- Will run
terraform destroy
in the current workspace folder. - Will destroy the Terraform-managed infrastructure.
- Open the Command Palette.
- Select 'Terraform Azure: init'.
- Will run
terraform init
in the current working directory.
- Open the Command Palette.
- Select 'Terraform Azure: validate'.
- Will run
terraform validate
in the current working directory. - If there is syntax errors in the current terraform project, they will be shown as the command result.
- Open the Command Palette.
- Select 'Terraform Azure: plan'.
- Will run
terraform plan
in the current working directory. - The command will show what actions are necessary to achieve the desired state specified in the configuration files.
- Open the Command Palette.
- Select 'Terraform Azure: apply'.
- Will run
terraform apply
in the current working directory. - Will apply the changes required to reach the desired state of the configuration.
- Open the Command Palette.
- Select 'Terraform Azure: refresh'.
- Will run
terraform refresh
in the current working directory. - Will reconcile the state Terraform knows about (via its state file) with the real-world infrastructure.
- Open the Command Palette.
- Select 'Terraform Azure: destroy'.
- Will run
terraform destroy
in the current working directory. - Will destroy the Terraform-managed infrastructure.
Prerequisite:
- This feature needs Docker installed and in the system path. If not, extension will tell user Docker is not installed.
- For the E2E test, the extension use Test Kitchen as the integration tool for testing infrastructure code. If you don't hava an project that has setup the integration tests, you can use this one: https://github.com/Azure/terraform-azurerm-network
- Open the Command Palette.
- Select 'Terraform Azure: execute test', then 'lint'.
- A Docker image will be run.
- Go to the output channel to see the result.
- Open the Command Palette.
- Select 'Terraform Azure: execute test', then 'end to end'.
- A Docker image will be run.
- Go to the output channel to see the result.
- Open the Command Palette.
- Select 'Terraform Azure: execute test', then 'custom'.
- A Docker image will be run and running the user customized command.
- Go to the output channel to see the result.
Notes: All the tests will be run in a real ACI on Azure, you can specify the ACI name and resource group name in VS Code settings, otherwise, extension will use default values. See README.MD for details.
- Open the Command Palette.
- Select 'Terraform Azure: execute test', then 'lint'.
- An ACI will be provisioned through terraform if target resource not exists.
- Entering 'az container logs -g tfTestResourceGroup -n tfTestContainerGroup' in the cloud shell terminal to view logs.
- Open the Command Palette.
- Select 'Terraform Azure: execute test', then 'end to end'.
- An ACI will be provisioned through terraform if target resource not exists.
- The ACI will run the E2E test.
- Entering 'az container logs -g tfTestResourceGroup -n tfTestContainerGroup' in the cloud shell terminal to view logs.
- Open the Command Palette.
- Select 'Terraform Azure: execute test', then 'custom'.
- An ACI will be provisioned through terraform if target resource not exists.
- The ACI will run the user customized command after starting up.
- Entering 'az container logs -g tfTestResourceGroup -n tfTestContainerGroup' in the cloud shell terminal to view logs.
Prerequisite: This feature needs Dot installed and in the system path. If not, extension will tell user Dot is not installed.
- Open a terraform project in vscode workspace.
- Click 'F1' to open the Command Palette.
- Select 'Terraform Azure: visualize'.
- A graph will be shown in VS Code representing either a configuration or execution plan.
- Popup an message dialog telling user that this feature is only available in integrated terminal.
- Popup an message dialog telling user that this feature is only available when using cloud shell.
- Push terraform project files onto the cloud. You can specify the file type you want to upload through extension settings. See README.MD for details.