From dc718eccede7fecfae3b5271a6b76eb501753902 Mon Sep 17 00:00:00 2001 From: Vitaly Antonenko Date: Thu, 7 Mar 2024 19:08:32 +0300 Subject: [PATCH 1/2] Adds info about `plangenerator` to README. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 230c5eb7..afe70c47 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,18 @@ Prior to running the tests locally, ensure you have the following environmental - `JUJU_PASSWORD` - `JUJU_CA_CERT` +### Writing Acceptance Tests + +Acceptance tests usually require Terraform plans to be included to the various steps of the test. +This plans can be generated with help of `testing/plangenerator` package. You may use `GetStringFromTemplateWithData` +function to generate a plan from a template. This function will replace the placeholders in the template with the data. + +The example can be found in the comments to `GetStringFromTemplateWithData` function. + +### Testing + +```shell + For example, here they are set using the currently active controller: ```shell From 7394506f025745a41902f6905314afaaaf656d4a Mon Sep 17 00:00:00 2001 From: Vitaly Antonenko Date: Thu, 7 Mar 2024 20:20:27 +0300 Subject: [PATCH 2/2] Fixes Section ordering. --- README.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index afe70c47..efbe32dd 100644 --- a/README.md +++ b/README.md @@ -78,24 +78,22 @@ If you wish to work on the provider, you'll first need [Go](http://www.golang.or See also [Building The Provider](#building-the-provider) -Prior to running the tests locally, ensure you have the following environmental variables set: - -- `JUJU_CONTROLLER_ADDRESSES` -- `JUJU_USERNAME` -- `JUJU_PASSWORD` -- `JUJU_CA_CERT` - ### Writing Acceptance Tests -Acceptance tests usually require Terraform plans to be included to the various steps of the test. +Acceptance tests usually require Terraform plans to be included to the various steps of the test. This plans can be generated with help of `testing/plangenerator` package. You may use `GetStringFromTemplateWithData` -function to generate a plan from a template. This function will replace the placeholders in the template with the data. +function to generate a plan from a template. This function will replace the placeholders in the template with the data. The example can be found in the comments to `GetStringFromTemplateWithData` function. -### Testing +### Running Acceptance Tests -```shell +Prior to running the tests locally, ensure you have the following environmental variables set: + +- `JUJU_CONTROLLER_ADDRESSES` +- `JUJU_USERNAME` +- `JUJU_PASSWORD` +- `JUJU_CA_CERT` For example, here they are set using the currently active controller: