You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: Enables simulation of cloud-dev using hoverfly in alert configuration acceptance tests (#2057)
* run capture mode in CI test to verify correct configuration of hoverfly ca cert
* remove general https proxy variable and adjust specific go client
* specify latest version of hoverfly
* workaround in client to be able to use hoverfly sdk
* adjust client code to use dynamic proxy port
* define env variables for capturing and simulating
* adding serialization of execution variables
* linter fixes
* define a single execution variables file per test
* avoid creating project during simulate mode
* fixing linter issues
* define separate function for mux provider factory explicit for testing
* replace hoverfly go sdk with cli to avoid usage of tls insecure flag
* addressing PR comments, removing repetition of t.cleanup in each test
* include small note in contribution guide
* double quotes in scripts
* simplify calls to ManageProjectID by changing signature
* adjust docs
-[Replaying HTTP Requests with Hoverfly](#replaying-http-requests-with-hoverfly)
13
14
-[Code and Test Best Practices](#code-and-test-best-practices)
14
15
-[Creating New Resource and Data Sources](#creating-new-resources-and-data-sources)
15
16
-[Scaffolding Initial Code and File Structure](#scaffolding-initial-code-and-file-structure)
@@ -252,7 +253,14 @@ You must also configure the following environment variables before running the t
252
253
~> **Notice:** Acceptance tests create real resources, and often cost money to run. Please note in any PRs made if you are unable to pay to run acceptance tests for your contribution. We will accept "best effort" implementations of acceptance tests in this case and run them for you on our side. This may delay the contribution but we do not want your contribution blocked by funding.
253
254
- Run `make testacc`
254
255
256
+
#### Replaying HTTP requests with hoverfly
255
257
258
+
Some resources allow recording and replaying http requests using hoverfly when running tests (e.g. alert_configuration acceptance tests). You will be able to identify this if the test calls `replay.SetupReplayProxy(t)`.
259
+
260
+
- For capturing http traffic of an execution you have to configure the environment variable `REPLAY_MODE=capture`. Captured request/responses will be present in the directory `./simulations`.
261
+
- For replaying http traffic of an execution you have to configure the environment variable `REPLAY_MODE=simulate` which will use files present in the simulation directory.
262
+
263
+
**Note**: [Hoverfly](https://docs.hoverfly.io/en/latest/pages/introduction/introduction.html) is the proxy server used for capturing and simulating request. You must use the following [installation docs](https://docs.hoverfly.io/en/latest/pages/introduction/downloadinstallation.html#download-and-installation) to have the CLI available, as well as setting up the [hoverfly CA cert](https://docs.hoverfly.io/en/latest/pages/tutorials/basic/https/https.html) in your trust store.
256
264
257
265
### Testing Atlas Provider Versions that are NOT hosted on Terraform Registry (i.e. pre-release versions)
258
266
To test development / pre-release versions of the Terraform Atlas Provider that are not hosted on the Terraform Registry, you will need to create a [Terraform Provider Network Mirror](https://developer.hashicorp.com/terraform/internals/provider-network-mirror-protocol).
0 commit comments