terratest icon indicating copy to clipboard operation
terratest copied to clipboard

Pull request 658

Open robcamer opened this issue 4 years ago • 9 comments

Azure Automation Account module for terratest with the following:

(i) terraform example in examples/azure folder (ii) automationaccount.go module in modules/azure folder (iii) unit test in test/azure folder (iv) integration test with example in test/azure folder

NOTE: This PR updates the workflow ci.yml to run tests using the azure +build tag. To validate this PR you must run the ci.yml in this branch as the ci.yml in master will break due to the automation account tests.

This PR adds a new ci workflow ci-automation.yml for the Automation Account tests that uses an azureautomation +build tag. The default ci.yml is updated to run the go linter tests based on the azure build tag: LINTER: ./bin/golangci-lint run ./test/azure/ --build-tags=azure --timeout 5m0s TESTS: go test -tags=azure -v -timeout 90m

The new ci-automation.yml has a build tag of azureuatomation LINTER: ./bin/golangci-lint run ./test/azure/ --build-tags=azureautomation --timeout 5m0s TEST: go test -tags=azureautomation -v -timeout 20m

This example requires a service principal and test certificate in order to run successfully. This is documented in the readme.md for the example: "In this case for the test example, the test self-signed certificate is base64 encoded and then set on the TF_VAR_automation_run_as_certificate_base64 environment variable. As an alternative, you could read the certificate from Key Vault as described above, which would be the recommended procedure in a production environment."

Fixes #658

robcamer avatar May 02 '21 17:05 robcamer

[Microsoft CI Bot] TL;DR; success :thumbsup:

You can check the status of the CI Pipeline logs here ; https://github.com/aztfmod/terratest/actions/runs/804759161

hattan avatar May 02 '21 18:05 hattan

[Microsoft CI Bot] TL;DR; success :thumbsup:

You can check the status of the CI Pipeline logs here ; https://github.com/aztfmod/terratest/actions/runs/837150407

hattan avatar May 12 '21 23:05 hattan

[Microsoft CI Bot] TL;DR; success :thumbsup:

You can check the status of the CI Pipeline logs here ; https://github.com/aztfmod/terratest/actions/runs/934339910

hattan avatar Jun 14 '21 02:06 hattan

[Microsoft CI Bot] TL;DR; success :thumbsup:

You can check the status of the CI Pipeline logs here ; https://github.com/aztfmod/terratest/actions/runs/934393839

hattan avatar Jun 14 '21 03:06 hattan

CI completed successfully after two additional commits to resolve feedback: https://github.com/aztfmod/terratest/actions/runs/934393839 (running the pipelines in this branch, pull-request-658)

robcamer avatar Jun 14 '21 13:06 robcamer

@HadwaAbdelhalem I ran the CI. There are errors for AKS and AvailabilitySet, but not Automation Account: https://github.com/aztfmod/terratest/runs/4051679037?check_suite_focus=true. How should we proceed?

robcamer avatar Nov 03 '21 18:11 robcamer

@HadwaAbdelhalem @yorinasub17. Resolved the merge conflict. I think this is ready. Thanks!

robcamer avatar Sep 08 '22 16:09 robcamer

@HadwaAbdelhalem @yorinasub17. Just checking if anything else is required? Thanks!

robcamer avatar Sep 23 '22 16:09 robcamer

Hi, looks like goimports should be applied

goimports................................................................Failed
- hook id: goimports
- files were modified by this hook

test/azure/terraform_azure_automationaccount_example_test.go
test/azure/terraform_azure_automationaccount_example_test.go
modules/azure/automationaccount_test.go
modules/azure/resourcegroup.go

denis256 avatar Sep 28 '22 18:09 denis256