Foundatio.AzureServiceBus icon indicating copy to clipboard operation
Foundatio.AzureServiceBus copied to clipboard

Unit Tests silently fail.

Open jamescurran opened this issue 5 years ago • 2 comments

IF the connection string isn't set in the appsettings.json file for the unit tests (as is the case in the checked-in file), all the test will just return without doing anything or triggering an assert (appearing to pass).

The lines at AzureServiceBusQueueTests.cs(21)

        if (String.IsNullOrEmpty(connectionString))
            return null;

need to be changed to something like:

         Assert.False(String.IsNullOrEmpty(connectionString), "AzureServiceBusConnectionString must be specified in the appsettings.json file");

jamescurran avatar Oct 23 '20 07:10 jamescurran

I believe the tests are getting an environment variable for the connection string that's encrypted. We wanted it so they don't fail if it's not specified but this could be argued it should fail with a message like this @ejsmith

niemyjski avatar Oct 23 '20 13:10 niemyjski

There was a time where we didn't have resources to be able to run them on every commit. So we changed it to skip like this, but we should have just removed running tests from the build instead. I agree with making it assert @jamescurran. Can you commit a PR for that?

Is there a local emulator for servicebus that we can use?

ejsmith avatar Oct 23 '20 14:10 ejsmith