Skip to content

Commit

Permalink
Tighten configure cross-tests
Browse files Browse the repository at this point in the history
As part of diagnosing #2530, this
commit tightens `crosstests.Configure`. My assumption is that we will occasionally see
failures in the bridged provider here.
  • Loading branch information
iwahbe committed Nov 1, 2024
1 parent 9bcae10 commit a5faae2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/internal/tests/cross-tests/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ func Configure(
return &schema.Provider{
Schema: provider,
ConfigureContextFunc: func(_ context.Context, rd *schema.ResourceData) (any, diag.Diagnostics) {
if rd == nil {
return nil, diag.Errorf("Attempted to configure the provider with nil %T", rd)
}
*writeTo = result{rd, true, false}

return configureResult, nil
Expand Down Expand Up @@ -114,7 +117,7 @@ func Configure(
require.NoError(t, tfd.Apply(t, plan))

require.True(t, tfResult.wasSet, "terraform configure result was not set")
require.True(t, tfResult.wasSet, "terraform resource result was not set")
require.True(t, tfResult.resourceCreated, "terraform resource result was not set")

bridgedProvider := pulcheck.BridgedProvider(
t, defProviderShortName, makeProvider(&puResult),
Expand Down Expand Up @@ -142,7 +145,7 @@ func Configure(
pt.Up(t)

require.True(t, tfResult.wasSet, "pulumi configure result was not set")
require.True(t, tfResult.wasSet, "pulumi resource result was not set")
require.True(t, tfResult.resourceCreated, "pulumi resource result was not set")

assertResourceDataEqual(t, provider, tfResult.data, puResult.data)
}
Expand Down

0 comments on commit a5faae2

Please sign in to comment.