Respawn Library Not Clearing Database

190 views Asked by At

I'm setting up integration tests and I'd like to use Jimmy Bogard's respawn library to intelligently clear out any data inserted during tests. My code is running against Azure databases. When I run a test the relevant reset code is being hit (I set breakpoints and confirmed that) but the database isn't being cleared. I confirmed that the connection string is correct. I have no idea what else could be wrong, any insight would be very helpful! Does the Respawn library work with Azure databases?

[Trait("Category", "Integration")]
    public abstract class IntegrationTestBase : IClassFixture<ApiWebApplicationFactory>
    {

        protected readonly ApiWebApplicationFactory _factory;
        protected readonly ITestOutputHelper _testOutputHelper;
        protected readonly HttpClient _client;
        private readonly Checkpoint _checkpoint = new ()
        {
            WithReseed = true,
        };

        public IntegrationTestBase(ApiWebApplicationFactory fixture, ITestOutputHelper testOutputHelper)
        {

            _factory = fixture;
            _testOutputHelper = testOutputHelper;
            _client = _factory.CreateClient();
            _client.DefaultRequestHeaders.Authorization =
                new AuthenticationHeaderValue("IntegrationTest");
            _testOutputHelper = testOutputHelper;
            _checkpoint.Reset(_factory.Configuration.GetConnectionString("DB_CONN"));
        }
    }
0

There are 0 answers