Rework TODOs to be clear that those are for testing support future work

Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
This commit is contained in:
Andrei Ciobanu
2025-08-25 12:27:12 +03:00
parent acea9e3030
commit 7bce533367
7 changed files with 10 additions and 10 deletions

View File

@@ -65,7 +65,7 @@ var (
},
},
},
// TODO ephemeral - when implementing testing support for ephemeral resources, consider configuring ephemeral schema here
// TODO ephemeral testing support - when implementing testing support for ephemeral resources, consider configuring ephemeral schema here
}
)

View File

@@ -97,7 +97,6 @@ func (h *countHook) PostDiff(addr addrs.AbsResourceInstance, gen states.Generati
defer h.Unlock()
// We don't count anything for data resources and neither for the ephemeral ones.
// TODO ephemeral - test this after the ephemeral resources are introduced entirely
if addr.Resource.Resource.Mode == addrs.DataResourceMode || addr.Resource.Resource.Mode == addrs.EphemeralResourceMode {
return tofu.HookActionContinue, nil
}

View File

@@ -1054,12 +1054,12 @@ func (c *Config) transformOverriddenResourcesForTest(run *TestRun, file *TestFil
}
if res.Mode != overrideRes.Mode {
// TODO ephemeral - include also the ephemeral resource and the test_file.go#override_ephemeral
// TODO ephemeral testing support - include also the ephemeral resource and the test_file.go#override_ephemeral
blockName, targetMode := blockNameOverrideResource, "data"
if overrideRes.Mode == addrs.DataResourceMode {
blockName, targetMode = blockNameOverrideData, "resource"
}
//It could be a warning, but for the sake of consistent UX let's make it an error
// It could be a warning, but for the sake of consistent UX let's make it an error
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: fmt.Sprintf("Unsupported `%v` target in `%v` block", targetMode, blockName),

View File

@@ -260,7 +260,8 @@ type TestRunOptions struct {
const (
blockNameOverrideResource = "override_resource"
blockNameOverrideData = "override_data"
//blockNameOverrideEphemeral = "override_ephemeral" // TODO ephemeral uncomment this when testing support will be added for ephemerals
// TODO ephemeral testing support - uncomment this when testing support will be added for ephemerals
// blockNameOverrideEphemeral = "override_ephemeral"
)
// OverrideResource contains information about a resource or data block to be overridden.

View File

@@ -1069,7 +1069,7 @@ func (d *evaluationStateData) GetOutput(_ context.Context, addr addrs.OutputValu
if output.Sensitive {
val = val.Mark(marks.Sensitive)
}
// TODO ephemeral - this GetOutput is used only during `tofu test` against root module outputs.
// TODO ephemeral testing support - this GetOutput is used only during `tofu test` against root module outputs.
// Therefore, since only the root module outputs can get in here, there is no reason to mark
// values with ephemeral. Reanalyse this when implementing the testing support.
// if config.Ephemeral {

View File

@@ -196,7 +196,7 @@ func TestEvaluatorGetOutputValue(t *testing.T) {
t.Errorf("wrong result %#v; want %#v", got, want)
}
// TODO ephemeral - uncomment the line with the ephemeral mark once the testing support implementation is done
// TODO ephemeral testing support - uncomment the line with the ephemeral mark once the testing support implementation is done
// want = cty.StringVal("third").Mark(marks.Ephemeral)
want = cty.StringVal("third")
got, diags = scope.Data.GetOutput(t.Context(), addrs.OutputValue{

View File

@@ -114,17 +114,17 @@ func (p providerForTest) ReadDataSource(_ context.Context, r providers.ReadDataS
}
func (p providerForTest) OpenEphemeralResource(_ context.Context, _ providers.OpenEphemeralResourceRequest) (resp providers.OpenEphemeralResourceResponse) {
//TODO ephemeral - implement me when adding testing support
// TODO ephemeral testing support - implement me when adding testing support
panic("implement me")
}
func (p providerForTest) RenewEphemeralResource(_ context.Context, _ providers.RenewEphemeralResourceRequest) (resp providers.RenewEphemeralResourceResponse) {
//TODO ephemeral - implement me when adding testing support
// TODO ephemeral testing support - implement me when adding testing support
panic("implement me")
}
func (p providerForTest) CloseEphemeralResource(_ context.Context, _ providers.CloseEphemeralResourceRequest) (resp providers.CloseEphemeralResourceResponse) {
//TODO ephemeral - implement me when adding testing support
// TODO ephemeral testing support - implement me when adding testing support
panic("implement me")
}