Skip to content

Commit 0da7e29

Browse files
authored
Add required environment variables for acceptance tests to run (#1294)
1 parent 99531a1 commit 0da7e29

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/copilot-instructions.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,21 @@ Carefully read the issue and think hard about a plan to solve it before coding.
5959
- Write additional tests if needed to capture important behaviors or edge cases.
6060
- Ensure all tests pass before finalizing.
6161

62+
### 6.1 Acceptance Testing Requirements
63+
When running acceptance tests (`make testacc`), ensure the following:
64+
65+
66+
- **Environment Variables** - The following environment variables are required for acceptance tests:
67+
- `ELASTICSEARCH_ENDPOINTS` (default: http://localhost:9200)
68+
- `ELASTICSEARCH_USERNAME` (default: elastic)
69+
- `ELASTICSEARCH_PASSWORD` (default: password)
70+
- `KIBANA_ENDPOINT` (default: http://localhost:5601)
71+
- `TF_ACC` (must be set to "1" to enable acceptance tests)
72+
- **Ensure a valid environment if using `go test`** - Check if the required environment variables are set, if not use the defaults specified above.
73+
- **Always finish with `make testacc`** - This will run all tests. Make sure all tests pass before considering a task complete.
74+
- **Pre-set Environment Variables** - Default environment variables are configured in the Makefile. If these defaults are suitable for your testing environment, `make testacc` will work directly without additional setup
75+
- **Docker Environment** - For isolated testing with guaranteed environment setup, use `make docker-testacc` which starts Elasticsearch and Kibana containers automatically
76+
6277
## 7. Final Verification
6378
- Confirm the root cause is fixed.
6479
- Review your solution for logic correctness and robustness.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ docker-clean: ## Try to remove provisioned nodes and assigned network
225225

226226
.PHONY: docs-generate
227227
docs-generate: tools ## Generate documentation for the provider
228-
@ go tool github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
228+
@ go tool github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name elasticstack
229229

230230

231231
.PHONY: gen

0 commit comments

Comments
 (0)