Skip to content

Commit

Permalink
update dynamic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VenelinMartinov committed Nov 25, 2024
1 parent 2b707c3 commit 2029b99
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions dynamic/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ func TestStacktraceDisplayed(t *testing.T) {
}

func TestPrimitiveTypes(t *testing.T) {
t.Parallel()
skipWindows(t)
// TODO[pulumi/pulumi-terraform-bridge#2517]: fix once accurate bridge previews are enabled by default
t.Setenv("PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW", "true")

ctx := context.Background()

Expand Down Expand Up @@ -114,26 +115,26 @@ func TestPrimitiveTypes(t *testing.T) {
t.Run("check", assertGRPCCall(grpc.Check, &pulumirpc.CheckRequest{
Urn: urn,
News: inputs(),
}))
}, noParallel))

t.Run("create(preview)", assertGRPCCall(grpc.Create, &pulumirpc.CreateRequest{
Preview: true,
Urn: urn,
Properties: inputs(),
}))
}, noParallel))

t.Run("create", assertGRPCCall(grpc.Create, &pulumirpc.CreateRequest{
Urn: urn,
Properties: inputs(),
}))
}, noParallel))

t.Run("diff(none)", assertGRPCCall(grpc.Diff, &pulumirpc.DiffRequest{
Id: "example-id-0",
Urn: urn,
Olds: outputs(),
News: inputs(),
OldInputs: inputs(),
}))
}, noParallel))

t.Run("diff(some)", assertGRPCCall(grpc.Diff, &pulumirpc.DiffRequest{
Id: "example-id-1",
Expand All @@ -155,7 +156,7 @@ func TestPrimitiveTypes(t *testing.T) {
"attrStringDefaultOverridden": resource.NewProperty("overridden"),
}),
OldInputs: inputs(),
}))
}, noParallel))

t.Run("diff(all)", assertGRPCCall(grpc.Diff, &pulumirpc.DiffRequest{
Id: "example-id-2",
Expand All @@ -177,13 +178,13 @@ func TestPrimitiveTypes(t *testing.T) {
"attrNumberRequired": resource.NewProperty(12.3456789),
}),
OldInputs: inputs(),
}))
}, noParallel))

t.Run("delete", assertGRPCCall(grpc.Delete, &pulumirpc.DeleteRequest{
Id: "example-id-delete",
Urn: urn,
Properties: outputs(),
}))
}, noParallel))

t.Run("update", assertGRPCCall(grpc.Update, &pulumirpc.UpdateRequest{
Id: "example-update-id",
Expand All @@ -192,18 +193,18 @@ func TestPrimitiveTypes(t *testing.T) {
News: marshal(with(outputProps(), resource.PropertyMap{
"attrBoolRequired": resource.NewProperty(false),
})),
}))
}, noParallel))

t.Run("read", assertGRPCCall(grpc.Read, &pulumirpc.ReadRequest{
Id: "example-read-id",
Urn: urn,
Properties: outputs(),
}))
}, noParallel))

t.Run("import", assertGRPCCall(grpc.Read, &pulumirpc.ReadRequest{
Id: "example-read-id",
Urn: urn,
}))
}, noParallel))
}

func TestConfigure(t *testing.T) {
Expand Down

0 comments on commit 2029b99

Please sign in to comment.