Skip to content

Commit

Permalink
echoprovider: Add a new test-only v6 provider that echoes ephemeral p…
Browse files Browse the repository at this point in the history
…rovider data (#389)

* implement EphemeralResoureServer

* create testprovider echo

* add 1.10.0 version constant

* fill out planresourcechange to actually make sense lol

* update resource type name

* tfversion: Add `SkipIfNotAlpha` version check

* changelog

* add tests to provider server and go package docs

* add copyright headers

* add version checks for protov6

* add website docs for ephemeral resources

* add changelogs

* adjust server implementation to always keep prior state

* remove incorrect section about dependency graph

* add -v to test runs

* add test to verify immutable resource data

* comma

* documentation updates

* doc comment update
  • Loading branch information
austinvalle authored Nov 19, 2024
1 parent 4a88926 commit 33bf5cf
Show file tree
Hide file tree
Showing 12 changed files with 1,126 additions and 19 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/FEATURES-20241111-165312.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: FEATURES
body: 'echoprovider: Introduced new `echoprovider` package, which contains a v6 Terraform
provider that can be used to test ephemeral resource data.'
time: 2024-11-11T16:53:12.399802-05:00
custom:
Issue: "389"
6 changes: 6 additions & 0 deletions .changes/unreleased/NOTES-20241111-165206.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: NOTES
body: 'echoprovider: The `echoprovider` package is considered experimental and may
be altered or removed in a subsequent release'
time: 2024-11-11T16:52:06.287978-05:00
custom:
Issue: "389"
2 changes: 1 addition & 1 deletion .github/workflows/ci-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- run: go mod download
- run: go test -coverprofile=coverage.out ./...
- run: go test -v -coverprofile=coverage.out ./...
env:
TF_ACC: "1"
- name: Remove wildcard suffix from TF version
Expand Down
20 changes: 20 additions & 0 deletions echoprovider/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Package echoprovider contains a protocol v6 Terraform provider that can be used to transfer data from
// provider configuration to state via a managed resource. This is only meant for provider acceptance testing
// of data that cannot be stored in Terraform artifacts (plan/state), such as an ephemeral resource.
//
// Example Usage:
//
// // Ephemeral resource that is under test
// ephemeral "examplecloud_thing" "this" {
// name = "thing-one"
// }
//
// provider "echo" {
// data = ephemeral.examplecloud_thing.this
// }
//
// resource "echo" "test" {} // The `echo.test.data` attribute will contain the ephemeral data from `ephemeral.examplecloud_thing.this`
package echoprovider
Loading

0 comments on commit 33bf5cf

Please sign in to comment.