Skip to content

Commit

Permalink
remove unused test
Browse files Browse the repository at this point in the history
  • Loading branch information
mutahhir committed Jun 13, 2024
1 parent e20891a commit cb28bf3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ package stackeval

import (
"context"
"fmt"
"testing"

"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/promising"
"github.com/hashicorp/terraform/internal/providers"
"github.com/hashicorp/terraform/internal/stacks/stackaddrs"
stacks_testing_provider "github.com/hashicorp/terraform/internal/stacks/stackruntime/testing"
"github.com/zclconf/go-cty/cty"
)

Expand Down Expand Up @@ -84,55 +80,3 @@ func TestLocalValueValue(t *testing.T) {
})
}
}

func TestLocalValueWithProvider(t *testing.T) {
ctx := context.Background()
cfg := testStackConfig(t, "local_value", "custom_provider")

tests := map[string]struct {
LocalName string
WantVal cty.Value
}{
"name": {
LocalName: "name",
WantVal: cty.StringVal("jackson"),
},
}

for name, test := range tests {
t.Run(name, func(t *testing.T) {
main := testEvaluator(t, testEvaluatorOpts{
Config: cfg,
ProviderFactories: map[addrs.Provider]providers.Factory{
addrs.NewDefaultProvider("test"): func() (providers.Interface, error) {
return stacks_testing_provider.NewProvider(), nil
},
},
})

promising.MainTask(ctx, func(ctx context.Context) (struct{}, error) {
promising.MainTask(ctx, func(ctx context.Context) (struct{}, error) {
mainStack := main.MainStack(ctx)
rootVal := mainStack.LocalValue(ctx, stackaddrs.LocalValue{Name: test.LocalName})
rootOutput := mainStack.OutputValues(ctx)[stackaddrs.OutputValue{Name: "name"}]
got, diags := rootVal.CheckValue(ctx, PlanPhase)

if diags.HasErrors() {
t.Errorf("unexpected errors\n%s", diags.Err().Error())
}

outs, diags := rootOutput.CheckResultValue(ctx, InspectPhase)
fmt.Printf("output: %#v\n", outs)

if got.Equals(test.WantVal).False() {
t.Errorf("got %s, want %s", got, test.WantVal)
}

return struct{}{}, nil
})
return struct{}{}, nil
})
})
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,6 @@ func TestPlanning_LocalsDataSource(t *testing.T) {
if cmp.Diff(mapOutput, expectedMap, ctydebug.CmpOptions) != "" {
t.Fatalf("map output is wrong, expected \n%+v,\ngot\n%+v", expectedMap, mapOutput)
}

Check failure on line 1021 in internal/stacks/stackruntime/internal/stackeval/planning_test.go

View workflow job for this annotation

GitHub Actions / Code Consistency Checks

this value of err is never used (SA4006)

}
default:
break
Expand Down

0 comments on commit cb28bf3

Please sign in to comment.