https://pulumi.com logo
#dotnet
Title
# dotnet
b

brash-solstice-49151

03/25/2024, 5:00 PM
Hi. I'm trying to write some unit tests for a stack that includes a couple of
StackReference
objects with public properties that use
RequireOutput
but I'm having no luck. I've followed the setup here: https://github.com/pulumi/examples/tree/master/testing-unit-cs and I've inspected the JSON configuration I'm setting for the
PULUMI_CONFIG
environment variable, but keep getting a null ref exception when trying to access any of these stack reference values 😞 anyone come across something similar?
FYI on the exception:
Copy code
Pulumi.RunException: failed with an unhandled exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Output<object> Pulumi.StackReference.RequireOutput(Input<string> name)+(ValueTuple<string, string, ImmutableDictionary<string, object>> v) => { }
   at Output<ValueTuple> Pulumi.Output<T>.Apply(Func<T, Task> func)+(T t) => { }
   at async Task<OutputData<U>> Pulumi.Output<T>.ApplyHelperAsync<U>(Task<OutputData<T>> dataTask, Func<T, Output<U>> func)
   at async Task<OutputData<T>> Pulumi.Output<T>+<>c__DisplayClass11_0.<WithIsSecret>g__GetData|0(?)+GetData(?)
   at async Task<OutputData<U>> Pulumi.Output<T>.ApplyHelperAsync<U>(Task<OutputData<T>> dataTask, Func<T, Output<U>> func)
   at Pulumi.Deployment.TestAsync(IMocks mocks, Func`2 runAsync, TestOptions options)