bedrock icon indicating copy to clipboard operation
bedrock copied to clipboard

[Bedrock] Update Bedrock Integration tests to have terraform commands and terratest script separate

Open NathanielRose opened this issue 5 years ago • 2 comments

As a: Developer

I want: Decoupling of Terraform commands from the Bedrock terratest integration scripts

So that: I can know when an integration test fails during deployment of resources, interoperability of resources, and deletion of resources.

Describe the solution you'd like: Terratest scripts should no longer directly call terraform commands, this should be handled by the pipeline yaml in separate steps. In addition, variable configurations should be passed between steps from successful terraform apply to the terratest validation.

Acceptance Criteria:

  • [ ] Decouple terraform init, plan, apply and destroy to separate steps in a template pipeline
  • [ ] Pass terraform configuration once successfully applied to terratest script
  • [ ] Build logic that surfaces cloud shell failures vs script failures

Additional context: Task of https://github.com/microsoft/bedrock/issues/964

Does this require updates to documentation?: Yes

NathanielRose avatar Feb 12 '20 19:02 NathanielRose

Steps:

  • Export Env Vars to map
  • Create a Resource Group
  • Copy to temporary infra folder
  • Export map with TF config
  • Terraform init
  • Terraform plan
  • Terraform Apply
  • Run terratest integration tests
  • Delete resources

NathanielRose avatar Feb 24 '20 22:02 NathanielRose

  • Related to: #1424

NathanielRose avatar May 27 '20 19:05 NathanielRose