Tests run locally, but fail in azure pipeline #11127
-
We have an aspire setup with quite a few dependencies, and runs fine locally, also the integration test run fine locally ( using DistributedApplicationTestingBuilder ), but the tests fail in an azure pipeline. If i look at the pipeline, i think it fails with a null reference exception even before the actual project setup is called: the exception seems to be triggered during the BeforeStartAsync() method.
I tried looking in the code on github, but line 463 in AzureResourcePreparer just point to a line where an InvalidOperationException is thrown. The incoming value parameter on which they call GetType() COULD be null i guess .... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
If you can provide a minimal repro then we can investigate |
Beta Was this translation helpful? Give feedback.
I fully understand, but i found the issue. Somewhere in the apphost setup, i am explicitly setting an environment variable. Locally this had a value, but in the azure pipeline this value was null. I might be a good idea to catch this case to prevent the nullref exception (and it would be convenient to know which environment parameter is null)
So this is where null was passed:
aspire/src/Aspire.Hosting.Azure/AzureResourcePreparer.cs
Line 377 in cfb79b0