Skip to content

Commit

Permalink
Tighten configure cross-tests (#2567)
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 authored Nov 1, 2024
1 parent 0854c53 commit d6f4fb7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 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 All @@ -141,8 +144,11 @@ 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, puResult.wasSet, "pulumi configure result was not set")
// We don't create a resource for Pulumi since `pulumi up` will always provision a provider, even when
// it won't be used in any resource creation.
//
// require.True(t, puResult.resourceCreated, "pulumi resource result was not set")

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

0 comments on commit d6f4fb7

Please sign in to comment.