Open iwahbe opened 1 week ago
@iwahbe Does the issue repro if you specify both programs manually? That'd help us determine if it is the testing library or the runtime going wrong.
Good question. The issue does repro:
func TestSingleNestedAttrFieldOverride(t *testing.T) {
t.Parallel()
crosstests.Configure(t,
schema.Schema{
Attributes: map[string]schema.Attribute{
"a": schema.SingleNestedAttribute{
Optional: true,
Attributes: map[string]schema.Attribute{
"as": schema.Int64Attribute{Optional: true},
},
},
},
},
map[string]cty.Value{
"a": cty.ObjectVal(map[string]cty.Value{
"as": cty.NumberIntVal(123),
}),
},
crosstests.ConfigurePulumiConfig(resource.PropertyMap{
"puAttr": resource.NewProperty(resource.PropertyMap{
"puNestedAttrField": resource.NewProperty(123.0),
}),
}),
crosstests.ConfigureProviderInfo(map[string]*info.Schema{
"a": {
Name: "puAttr",
Elem: &info.Schema{Fields: map[string]*info.Schema{
"as": {Name: "puNestedAttrField"},
}},
},
}),
)
}
Diff:
--- Expected
+++ Actual
@@ -36,13 +36,3 @@
},
- value: (*big.Float)({
- prec: (uint32) 64,
- mode: (big.RoundingMode) 0,
- acc: (big.Accuracy) 0,
- form: (big.form) 1,
- neg: (bool) false,
- mant: (big.nat) (len=1) {
- (big.Word) 17726168133330272256
- },
- exp: (int32) 7
- })
+ value: (interface {}) <nil>
}
Test: TestSingleNestedAttrFieldOverride/compare
It looks like we silently drop the value.
The following cross test fails with a type error:
Since
cty.Value
toresource.PropertyMap
conversion is performed using the same library (convert
) that PF uses at runtime, I suspect that this is a genuine bug. If not, thenpf/.../cross-tests
is holding the library wrong.