aztfmod / rover

The rover is a docker container in charge of the deployment of the Terraform platform engineering for Azure
MIT License
173 stars 144 forks source link

Add support for Rover test #157

Closed hattan closed 3 years ago

hattan commented 3 years ago

This PR introduce a rover test command. Rover test allows you to execute terratest integration tests against a deployed CAF environment.

The workflow would be to first deploy and environment then can rover test with the following options:

rover test \
      -b <path to test folder> \
      -env <environment name> \
      -level <level> \
      -tfstate <state file> \
      -d 

In order to run test all the above parameters must be supplied including level, environment and state file name.

It's also expected that the tests use go build tags with the following tags:

For example tests, please see: https://github.com/aztfmod/symphony/blob/rover_test/tests/level0_test.go

The example tests above use local state in order to verify that the resources were deployed correctly to azure. To facilitate this, rover test downloads the state file and renames it to terraform.tfstate (needed by terratest) then removes the state file after test execution.

hieumoscow commented 3 years ago

Thanks @hattan, testing for AKS Construction Sets Landing zone in Starter repo

hattan commented 3 years ago

@LaurentLesle if it's cool, can we do that in another targeted pr?