src-d / terraform-provider-online

Terraform provider for Online.net
Mozilla Public License 2.0
19 stars 13 forks source link

Document how to run acceptance test #39

Open remyleone opened 6 years ago

remyleone commented 6 years ago

Could you have a test fixtures https://dave.cheney.net/2016/05/10/test-fixtures-in-go that contain credentials to a specific set of resources?

I would like to test this provider easily with an internal account that got many resources.

meyskens commented 6 years ago

to specify: for acceptance tests

rporres commented 6 years ago

This is a very good idea. @meyskens and myself were discussing a couple of days ago how our acceptance tests were very much linked to our own details. This would make things easy if you want to test in other environments.

There's one thing that I don't understand. As far as I understand the proposal in the blog, we would store in the fixtures data about the resources: ids, rpnv2 names, ips, macs and so on, but we would not store any credential as those should be set in the provider or using the ONLINE_TOKEN env variable

remyleone commented 6 years ago

You can have a credentials.example.yml that is a template with credentials blocks and comments that explain how to get started. Then users copy this to a file named credentials.yml that contain the actual credentials and that is read when the tests are launched.

remyleone commented 6 years ago

Feel free to add a pre-flight check to ensure that the file exists and are correctly filled up.

rporres commented 6 years ago

The idea looks great. The only thing that I wouldn't do is to call that fixture credentials.yaml as it is misleading: it won't contain any credentials.