TritonDataCenter / terraform-provider-triton

Terraform Joyent Triton provider
https://www.terraform.io/docs/providers/triton/
Mozilla Public License 2.0
15 stars 24 forks source link

Add sweepers for Triton Machines and Firewall Rules #47

Closed stack72 closed 7 years ago

stack72 commented 7 years ago

Fixes: #46

This requires TRITON_ACCOUNT and TRITON_KEY_ID to be set. You must pass it a list of regions to run acess. It can take a comma separated list

Then it can be run as follows:

go test ./triton -v -sweep=us-sw-1,us-east-1

This gives us the output as follows:

2017/10/05 14:12:40 [DEBUG] Running Sweepers for region (us-sw-1):
2017/10/05 14:12:41 [DEBUG] Found 0 rules to sweep
2017/10/05 14:12:43 [DEBUG] Found 1 instances to sweep
2017/10/05 14:12:43 Destroying instance acctest-1533927144703045735
2017/10/05 14:12:44 Sweeper Tests ran:
    - triton_firewall_rule
    - triton_machine
ok      github.com/terraform-providers/terraform-provider-triton/triton    4.231s
jwreagor commented 7 years ago

Also, can we add this to our makefile for sweeping before our testacc target?

EDIT: Optionally sweep before testacc since some folks might not need to sweep all the time.